PluginProbe
ShopBuilder – WooCommerce Builder For Elementor / 1.0.0
ShopBuilder – WooCommerce Builder For Elementor v1.0.0
3.4.2 3.4.1 3.4.0 2.0.1 2.0.2 2.0.3 2.1.0 2.1.1 2.1.10 2.1.11 2.1.12 2.1.13 2.1.14 2.1.15 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 2.2.0 2.2.1 2.2.2 All 63 releases
shopbuilder / app / Elementor / Widgets / General / SocialShare.php

SocialShare.php in ShopBuilder – WooCommerce Builder For Elementor 1.0.0, at app/Elementor/Widgets/General/SocialShare.php

116 lines 2.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * SocialShare class.
4 *
5 * @package RadiusTheme\SB
6 */
7
8 namespace RadiusTheme\SB\Elementor\Widgets\General;
9
10 use RadiusTheme\SB\Helpers\Fns;
11 use RadiusTheme\SB\Elementor\Render\Render;
12 use RadiusTheme\SB\Elementor\Widgets\Controls;
13 use RadiusTheme\SB\Abstracts\ElementorWidgetBase;
14
15 // Do not allow directly accessing this file.
16 if ( ! defined( 'ABSPATH' ) ) {
17 exit( 'This script cannot be accessed directly.' );
18 }
19
20 /**
21 * SocialShare class.
22 */
23 class SocialShare extends ElementorWidgetBase {
24 /**
25 * Control Fields
26 *
27 * @var array
28 */
29 private $control_fields = [];
30
31 /**
32 * Construct function
33 *
34 * @param array $data default array.
35 * @param mixed $args default arg.
36 */
37 public function __construct( $data = [], $args = null ) {
38 $this->rtsb_name = esc_html__( 'Social Share', 'shopbuilder' );
39 $this->rtsb_base = 'rtsb-social-share';
40
41 parent::__construct( $data, $args );
42
43 $this->pro_tab = 'content';
44 $this->rtsb_category = 'rtsb-shopbuilder-general';
45 }
46
47 /**
48 * Controls for layout tab
49 *
50 * @return SocialShare
51 */
52 protected function layout_tab() {
53 $sections = apply_filters(
54 'rtsb/elements/elementor/share_layout_tab',
55 array_merge(
56 Controls\ContentFields::share_presets( $this ),
57 Controls\ContentFields::share_platforms( $this ),
58 )
59 );
60
61 $this->control_fields = array_merge( $this->control_fields, $sections );
62
63 return $this;
64 }
65
66 /**
67 * Controls for style tab
68 *
69 * @return SocialShare
70 */
71 protected function style_tab() {
72 $sections = apply_filters(
73 'rtsb/elements/elementor/share_style_tab',
74 array_merge(
75 Controls\StyleFields::share_items( $this ),
76 Controls\StyleFields::share_icons( $this ),
77 Controls\StyleFields::share_text( $this ),
78 )
79 );
80
81 $this->control_fields = array_merge( $this->control_fields, $sections );
82
83 return $this;
84 }
85
86 /**
87 * Widget Field
88 *
89 * @return void|array
90 */
91 public function widget_fields() {
92 $this->layout_tab()->style_tab();
93
94 if ( empty( $this->control_fields ) ) {
95 return [];
96 }
97
98 return apply_filters( 'rtsb/elements/elementor/general/' . $this->rtsb_base, $this->control_fields, $this );
99 }
100
101 /**
102 * Render Function
103 *
104 * @return void
105 */
106 protected function render() {
107 $settings = $this->get_settings_for_display();
108 $this->theme_support();
109 $template = 'elementor/general/social-share';
110
111 Fns::print_html( Render::instance()->social_share_view( $template, $settings ), true );
112 $this->theme_support( 'render_reset' );
113 }
114
115 }
116