PluginProbe
ShopBuilder – WooCommerce Builder For Elementor / 3.2.6
ShopBuilder – WooCommerce Builder For Elementor v3.2.6
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 / ShopBuilderButton / ShopBuilderButton.php

ShopBuilderButton.php in ShopBuilder – WooCommerce Builder For Elementor 3.2.6, at app/Elementor/Widgets/General/ShopBuilderButton/ShopBuilderButton.php

123 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 * AdvancedHeading class.
4 *
5 * @package RadiusTheme\SB
6 */
7
8 namespace RadiusTheme\SB\Elementor\Widgets\General\ShopBuilderButton;
9
10 use RadiusTheme\SB\Helpers\Fns;
11 use RadiusTheme\SB\Abstracts\ElementorWidgetBase;
12
13 // Do not allow directly accessing this file.
14 if ( ! defined( 'ABSPATH' ) ) {
15 exit( 'This script cannot be accessed directly.' );
16 }
17
18 /**
19 * Dropcaps class.
20 *
21 * @package RadiusTheme\SB
22 */
23 class ShopBuilderButton extends ElementorWidgetBase {
24 /**
25 * Construct function
26 *
27 * @param array $data default array.
28 * @param mixed $args default arg.
29 */
30 public function __construct( $data = [], $args = null ) {
31 $this->rtsb_name = esc_html__( 'Advanced Button', 'shopbuilder' );
32 $this->rtsb_base = 'rtsb-shopbuilder-button';
33
34 parent::__construct( $data, $args );
35
36 $this->rtsb_category = 'rtsb-shopbuilder-general';
37 }
38 /**
39 * Whether the element returns dynamic content.
40 *
41 * @return bool
42 */
43 protected function is_dynamic_content(): bool {
44 return false;
45 }
46 /**
47 * Widget Field
48 *
49 * @return array
50 */
51 public function widget_fields() {
52 $value = array_merge(
53 Controls::content( $this ),
54 Controls::style( $this ),
55 );
56 return $value;
57 }
58 /**
59 * Set Widget Keyword.
60 *
61 * @return array
62 */
63 public function get_keywords() {
64 return [ 'Button','ShopBuilder Button' ] + parent::get_keywords();
65 }
66
67 /**
68 * Style dependencies.
69 *
70 * @return array
71 */
72 public function get_style_depends(): array {
73 if ( ! $this->is_edit_mode() ) {
74 return [
75 'rtsb-general-addons',
76 ];
77 }
78
79 return [
80 'rtsb-general-addons',
81 'elementor-icons-shared-0',
82 'elementor-icons-fa-solid',
83 ];
84 }
85
86 /**
87 * Addon Render.
88 *
89 * @return void
90 */
91 protected function render() {
92 $settings = $this->get_settings_for_display();
93 switch ( $settings['layout_style'] ) {
94 case 'rtsb-sb-button-layout2':
95 $template = 'layout2';
96 break;
97 default:
98 $template = 'layout1';
99 break;
100 }
101 $template = apply_filters( 'rtsb/general_widget/shopbuilder_button/template', $template, $settings );
102 $data = [
103 'template' => 'elementor/general/shopbuilder-button/' . $template,
104 'id' => $this->get_id(),
105 'unique_name' => $this->get_unique_name(),
106 'layout' => $settings['layout_style'],
107 'settings' => $settings,
108 'is_carousel' => false,
109 'container_class' => '',
110 'content_class' => $settings['button_hover_effects'] ?? '',
111 ];
112
113 // Render initialization.
114 $this->theme_support();
115
116 // Call the template rendering method.
117 Fns::print_html( ( new Render() )->display_content( $data, $settings ), true );
118
119 // Ending the render.
120 $this->theme_support( 'render_reset' );
121 }
122 }
123