PluginProbe
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot / 4.9.0
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot v4.9.0
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 3.5.2 All 199 releases
betterdocs / includes / Editors / BlockEditor / Blocks / SocialShare.php

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

57 lines 1.3 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
11 protected $map_view_vars = [
12 'share_title' => 'title',
13 'share_title_tag' => 'title_tag'
14 ];
15
16 protected $editor_styles = [
17 'betterdocs-social-share'
18 ];
19
20 protected $frontend_styles = [
21 'betterdocs-social-share'
22 ];
23
24 public function get_name() {
25 return 'social-share';
26 }
27
28 public function get_default_attributes() {
29 return [
30 'show_facebook_icon' => true,
31 'show_twitter_icon' => true,
32 'show_linkedin_icon' => true,
33 'show_pinterest_icon' => true,
34 'show_instagram_icon' => true,
35 'share_title' => __( 'Share This Article: ', 'betterdocs' ),
36 'share_title_tag' => 'h4',
37 'layout' => 'layout-1'
38 ];
39 }
40
41 protected $deprecated_attributes = [
42 'show_facebook_icon' => 'facebook',
43 'show_pinterest_icon' => 'pinterest',
44 'show_twitter_icon' => 'twitter',
45 'show_linkedin_icon' => 'linkedin'
46 ];
47
48 public function render( $attributes, $content ) {
49 $layout = $attributes['layout'];
50 if ( $layout == 'layout-1' ) {
51 $this->views( 'widgets/social' );
52 } else {
53 $this->views( 'widgets/social-2' );
54 }
55 }
56 }
57