PluginProbe
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot / 3.8.1
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot v3.8.1
4.9.2 4.9.1 4.9.0 4.8.2 4.8.1 4.8.0 4.7.0 4.6.2 4.6.1 4.6.0 4.5.6 4.5.5 4.5.4 4.5.3 4.5.2 4.5.1 4.5.0 4.4.1 4.4.0 3.3.4 3.4.0 3.4.1 3.4.2 3.5.0 3.5.1 All 200 releases
betterdocs / includes / Editors / BlockEditor / Blocks / SocialShare.php

SocialShare.php in BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot 3.8.1, at includes/Editors/BlockEditor/Blocks/SocialShare.php

54 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace WPDeveloper\BetterDocs\Editors\BlockEditor\Blocks;
4
5 use WPDeveloper\BetterDocs\Editors\BlockEditor\Block;
6 use WPDeveloper\BetterDocs\Traits\SocialShare as SocialShareTrait;
7
8 class SocialShare extends Block {
9 use SocialShareTrait;
10 protected $map_view_vars = [
11 'share_title' => 'title'
12 ];
13
14 protected $editor_styles = [
15 'betterdocs-social-share'
16 ];
17
18 protected $frontend_styles = [
19 'betterdocs-social-share'
20 ];
21
22 public function get_name() {
23 return 'social-share';
24 }
25
26 public function get_default_attributes() {
27 return [
28 'show_facebook_icon' => true,
29 'show_twitter_icon' => true,
30 'show_linkedin_icon' => true,
31 'show_pinterest_icon' => true,
32 'show_instagram_icon' => true,
33 'share_title' => __( 'Share This Article: ', 'betterdocs' ),
34 'layout' => 'layout-1'
35 ];
36 }
37
38 protected $deprecated_attributes = [
39 'show_facebook_icon' => 'facebook',
40 'show_pinterest_icon' => 'pinterest',
41 'show_twitter_icon' => 'twitter',
42 'show_linkedin_icon' => 'linkedin'
43 ];
44
45 public function render( $attributes, $content ) {
46 $layout = $attributes['layout'];
47 if( $layout == 'layout-1' ) {
48 $this->views( 'widgets/social' );
49 } else {
50 $this->views( 'widgets/social-2' );
51 }
52 }
53 }
54