PluginProbe ʕ •ᴥ•ʔ
Premium Addons for Elementor – Powerful Elementor Templates & Widgets / 4.11.77
Premium Addons for Elementor – Powerful Elementor Templates & Widgets v4.11.77
4.11.79 4.11.78 4.11.77 4.11.76 4.11.75 3.20.5 4.11.69 3.20.6 4.11.7 3.20.7 4.11.70 3.20.8 4.11.71 3.20.9 4.11.72 3.21.1 4.11.73 3.21.2 4.11.74 3.21.3 4.11.8 3.21.4 4.11.9 3.21.5 4.2.0 3.21.6 4.2.1 3.3.0 4.2.2 3.3.1 4.2.3 3.3.2 4.2.4 3.3.3 4.2.5 3.3.4 4.2.6 3.3.5 4.2.7 3.3.6 4.2.8 3.3.7 4.2.9 3.3.8 4.3.0 3.3.9 4.3.1 3.4.0 4.3.2 3.4.1 4.3.3 3.4.2 4.3.4 3.4.3 4.3.5 3.4.4 4.3.6 3.4.5 4.3.7 3.4.6 4.3.8 3.4.7 4.3.9 3.4.8 4.4.0 3.4.9 4.4.1 3.5.0 4.4.2 3.5.1 4.4.3 3.5.2 4.4.4 3.5.3 4.4.5 3.5.4 4.4.6 3.5.5 4.4.7 3.5.6 4.4.8 3.5.7 4.4.9 3.5.8 4.5.0 3.5.9 4.5.1 3.6.0 4.5.2 3.6.1 4.5.3 3.6.2 4.5.4 3.6.3 4.5.5 3.6.4 4.5.6 3.6.5 4.5.7 3.6.6 4.5.8 3.6.7 4.5.9 3.6.8 4.6.0 3.6.9 4.6.1 3.7.0 4.7.0 3.7.1 4.7.1 3.7.2 4.7.2 3.7.3 4.7.3 3.7.4 4.7.4 3.7.5 4.7.5 3.7.6 4.7.6 3.7.7 4.7.7 3.7.8 4.7.8 3.7.9 4.7.9 3.8.0 4.8.0 3.8.1 4.8.1 3.8.2 4.8.10 3.8.3 4.8.11 3.8.4 4.8.2 3.8.5 4.8.3 3.8.6 4.8.4 3.8.7 4.8.5 3.8.8 4.8.6 3.8.9 4.8.7 3.9.0 4.8.8 3.9.1 4.8.9 3.9.2 4.9.0 3.9.3 4.9.0-beta1 3.9.4 4.9.0-beta2 3.9.5 4.9.1 3.9.6 4.9.10 3.9.7 4.9.11 3.9.8 4.9.12 3.9.9 4.9.13 4.0.1 4.9.14 4.0.3 4.9.15 4.0.4 4.9.16 4.0.5 4.9.17 4.0.6 4.9.18 4.0.7 4.9.19 4.0.8 4.9.2 4.0.9 4.9.20 4.1.0 4.9.21 4.1.1 4.9.22 4.1.2 4.9.23 4.1.3 4.9.24 trunk 4.1.4 4.9.25 1.0 4.1.5 4.9.26 1.01 4.1.6 4.9.27 1.02 4.1.7 4.9.28 1.03 4.1.8 4.9.29 1.04 4.1.9 4.9.3 1.05 4.10.0 4.9.30 1.06 4.10.1 4.9.31 1.07 4.10.10 4.9.32 1.08 4.10.11 4.9.33 1.09 4.10.12 4.9.34 2.0 4.10.13 4.9.35 2.0.1 4.10.14 4.9.36 2.0.2 4.10.15 4.9.37 2.0.3 4.10.16 4.9.38 2.0.4 4.10.17 4.9.39 2.0.5 4.10.18 4.9.4 2.0.6 4.10.19 4.9.40 2.0.7 4.10.2 4.9.41 2.0.8 4.10.20 4.9.42 2.0.9 4.10.21 4.9.43 2.1.0 4.10.22 4.9.45 2.1.1 4.10.23 4.9.46 2.1.2 4.10.24 4.9.47 2.1.3 4.10.25 4.9.48 2.1.4 4.10.26 4.9.49 2.1.5 4.10.27 4.9.5 2.1.5-beta1 4.10.28 4.9.50 2.1.6 4.10.29 4.9.51 2.1.7 4.10.3 4.9.52 2.1.8 4.10.30 4.9.53 2.1.9 4.10.31 4.9.54 2.2.0 4.10.32 4.9.55 2.2.1 4.10.33 4.9.56 2.2.2 4.10.34 4.9.57 2.2.3 4.10.35 4.9.6 2.2.4 4.10.36 4.9.7 2.2.5 4.10.37 4.9.8 2.2.6 4.10.38 4.9.9 2.2.7 4.10.39 2.2.8 4.10.4 2.2.9 4.10.40 2.3.0 4.10.41 2.3.1 4.10.42 2.3.2 4.10.43 2.3.3 4.10.44 2.3.4 4.10.45 2.3.5 4.10.46 2.3.6 4.10.47 2.3.7 4.10.48 2.3.8 4.10.49 2.3.9 4.10.5 2.4.0 4.10.50 2.4.1 4.10.51 2.5.0 4.10.52 2.5.1 4.10.53 2.5.2 4.10.54 2.5.3 4.10.55 2.5.4 4.10.56 2.5.5 4.10.57 2.5.6 4.10.58 2.5.7 4.10.59 2.5.8 4.10.6 2.5.9 4.10.60 2.6.0 4.10.61 2.6.1 4.10.62 2.6.2 4.10.63 2.6.3 4.10.64 2.6.4 4.10.65 2.6.5 4.10.66 2.6.6 4.10.67 2.6.7 4.10.68 2.6.8 4.10.69 2.6.9 4.10.7 2.7.0 4.10.70 2.7.1 4.10.71 2.7.2 4.10.72 2.7.3 4.10.73 2.7.4 4.10.74 2.7.5 4.10.75 2.7.6 4.10.76 2.7.7 4.10.77 2.7.8 4.10.78 2.7.9 4.10.79 2.8.0 4.10.8 2.8.1 4.10.80 2.8.2 4.10.81 2.8.3 4.10.82 2.8.4 4.10.83 2.8.5 4.10.84 2.8.6 4.10.85 2.8.7 4.10.86 2.8.8 4.10.87 2.8.9 4.10.88 2.9.0 4.10.89 2.9.1 4.10.9 2.9.2 4.10.90 2.9.3 4.11.0 2.9.4 4.11.1 2.9.5 4.11.10 2.9.6 4.11.11 2.9.7 4.11.12 2.9.8 4.11.13 2.9.9 4.11.14 3.0.0 4.11.15 3.0.1 4.11.16 3.0.2 4.11.17 3.0.3 4.11.18 3.0.4 4.11.19 3.0.5 4.11.2 3.0.6 4.11.20 3.0.7 4.11.21 3.0.8 4.11.22 3.0.9 4.11.23 3.1.0 4.11.24 3.1.1 4.11.25 3.1.2 4.11.26 3.1.3 4.11.27 3.1.4 4.11.28 3.1.5 4.11.29 3.1.6 4.11.3 3.1.7 4.11.30 3.1.8 4.11.31 3.1.9 4.11.32 3.10.0 4.11.33 3.10.1 4.11.34 3.10.2 4.11.35 3.10.3 4.11.36 3.10.4 4.11.37 3.10.5 4.11.38 3.10.6 4.11.39 3.10.7 4.11.4 3.10.8 4.11.40 3.10.9 4.11.41 3.11.0 4.11.42 3.11.1 4.11.43 3.11.2 4.11.44 3.11.3 4.11.45 3.11.4 4.11.46 3.11.5 4.11.47 3.11.6 4.11.48 3.11.7 4.11.49 3.11.8 4.11.5 3.11.9 4.11.50 3.12.0 4.11.51 3.12.1 4.11.52 3.12.2 4.11.53 3.12.3 4.11.54 3.2.0 4.11.55 3.2.1 4.11.56 3.2.2 4.11.57 3.2.3 4.11.58 3.2.4 4.11.59 3.2.5 4.11.6 3.2.6 4.11.60 3.2.7 4.11.61 3.2.8 4.11.62 3.2.9 4.11.63 3.20.0 4.11.64 3.20.1 4.11.65 3.20.2 4.11.66 3.20.3 4.11.67 3.20.4 4.11.68
premium-addons-for-elementor / widgets / premium-button.php
premium-addons-for-elementor / widgets Last commit date
dep 1 month ago premium-banner.php 3 weeks ago premium-blog.php 3 weeks ago premium-button.php 3 weeks ago premium-carousel.php 3 weeks ago premium-contactform.php 3 weeks ago premium-countdown.php 3 weeks ago premium-counter.php 3 weeks ago premium-dual-header.php 3 weeks ago premium-fancytext.php 3 weeks ago premium-grid.php 3 weeks ago premium-icon-list.php 3 weeks ago premium-image-button.php 3 weeks ago premium-image-scroll.php 3 weeks ago premium-image-separator.php 3 weeks ago premium-lottie.php 3 weeks ago premium-maps.php 3 weeks ago premium-media-wheel.php 3 weeks ago premium-mobile-menu.php 3 weeks ago premium-modalbox.php 3 weeks ago premium-nav-menu.php 3 weeks ago premium-notifications.php 3 weeks ago premium-person.php 3 weeks ago premium-pinterest-feed.php 3 weeks ago premium-post-ticker.php 3 weeks ago premium-pricing-table.php 3 weeks ago premium-progressbar.php 3 weeks ago premium-search-form.php 3 weeks ago premium-svg-drawer.php 3 weeks ago premium-tcloud.php 3 weeks ago premium-testimonials.php 3 weeks ago premium-textual-showcase.php 3 weeks ago premium-tiktok-feed.php 3 weeks ago premium-title.php 3 weeks ago premium-videobox.php 3 weeks ago premium-vscroll.php 3 weeks ago premium-weather.php 3 weeks ago premium-world-clock.php 3 weeks ago
premium-button.php
1904 lines
1 <?php
2 /**
3 * Premium Button.
4 */
5
6 namespace PremiumAddons\Widgets;
7
8 // Elementor Classes.
9 use Elementor\Icons_Manager;
10 use Elementor\Widget_Base;
11 use Elementor\Controls_Manager;
12 use Elementor\Core\Kits\Documents\Tabs\Global_Colors;
13 use Elementor\Core\Kits\Documents\Tabs\Global_Typography;
14 use Elementor\Group_Control_Border;
15 use Elementor\Group_Control_Typography;
16 use Elementor\Group_Control_Text_Shadow;
17 use Elementor\Group_Control_Box_Shadow;
18
19 // PremiumAddons Classes.
20 use PremiumAddons\Admin\Includes\Admin_Helper;
21 use PremiumAddons\Includes\Helper_Functions;
22 use PremiumAddons\Includes\Controls\Premium_Post_Filter;
23
24 if ( ! defined( 'ABSPATH' ) ) {
25 exit; // If this file is called directly, abort.
26 }
27
28 /**
29 * Class Premium_Button
30 */
31 class Premium_Button extends Widget_Base {
32
33 /**
34 * Check if the icon draw is enabled.
35 *
36 * @since 4.9.26
37 * @access private
38 *
39 * @var bool
40 */
41 private $is_draw_enabled = null;
42
43 /**
44 * Check Icon Draw Option.
45 *
46 * @since 4.9.26
47 * @access public
48 */
49 public function check_icon_draw() {
50
51 if ( null === $this->is_draw_enabled ) {
52 $this->is_draw_enabled = Admin_Helper::check_svg_draw( 'premium-button' );
53 }
54
55 return $this->is_draw_enabled;
56 }
57
58 /**
59 * Retrieve Widget Name.
60 *
61 * @since 1.0.0
62 * @access public
63 */
64 public function get_name() {
65 return 'premium-addon-button';
66 }
67
68 /**
69 * Retrieve Widget Title.
70 *
71 * @since 1.0.0
72 * @access public
73 */
74 public function get_title() {
75 return __( 'Button', 'premium-addons-for-elementor' );
76 }
77
78 /**
79 * Retrieve Widget Icon.
80 *
81 * @since 1.0.0
82 * @access public
83 *
84 * @return string widget icon.
85 */
86 public function get_icon() {
87 return 'pa-button';
88 }
89
90 /**
91 * Retrieve Widget Dependent CSS.
92 *
93 * @since 1.0.0
94 * @access public
95 *
96 * @return array CSS style handles.
97 */
98 public function get_style_depends() {
99 return array(
100 'pa-glass',
101 'pa-btn',
102 'premium-addons',
103 );
104 }
105
106 /**
107 * Retrieve Widget Dependent JS.
108 *
109 * @since 1.0.0
110 * @access public
111 *
112 * @return array JS script handles.
113 */
114 public function get_script_depends() {
115
116 $is_edit = Helper_Functions::is_edit_mode();
117
118 $scripts = array();
119
120 if ( $is_edit ) {
121
122 $draw_scripts = $this->check_icon_draw() ? array( 'pa-tweenmax', 'pa-motionpath' ) : array();
123
124 $scripts = array_merge( $draw_scripts, array( 'lottie-js', 'pa-glass' ) );
125
126 } else {
127 $settings = $this->get_settings();
128
129 if ( 'yes' === $settings['draw_svg'] ) {
130 $scripts[] = 'pa-tweenmax';
131 $scripts[] = 'pa-motionpath';
132 }
133
134 if ( 'animation' === $settings['icon_type'] || 'animation' === $settings['slide_icon_type'] ) {
135 $scripts[] = 'lottie-js';
136 }
137
138 if ( 'none' !== $settings['btn_lq_effect'] ) {
139 $scripts[] = 'pa-glass';
140 }
141 }
142
143 $scripts[] = 'premium-addons';
144
145 return $scripts;
146 }
147
148 /**
149 * Retrieve Widget Keywords.
150 *
151 * @since 1.0.0
152 * @access public
153 *
154 * @return array Widget keywords.
155 */
156 public function get_keywords() {
157 return array( 'pa', 'premium', 'premium button', 'cta', 'call', 'link', 'btn' );
158 }
159
160 protected function is_dynamic_content(): bool {
161 return false;
162 }
163
164 /**
165 * Retrieve Widget Categories.
166 *
167 * @since 1.5.1
168 * @access public
169 *
170 * @return array Widget categories.
171 */
172 public function get_categories() {
173 return array( 'premium-elements' );
174 }
175
176 /**
177 * Retrieve Widget Support URL.
178 *
179 * @access public
180 *
181 * @return string support URL.
182 */
183 public function get_custom_help_url() {
184 return 'https://premiumaddons.com/support/';
185 }
186
187 public function has_widget_inner_wrapper(): bool {
188 return ! Helper_Functions::check_elementor_experiment( 'e_optimized_markup' );
189 }
190
191 /**
192 * Register Button controls.
193 *
194 * @since 1.0.0
195 * @access protected
196 */
197 protected function register_controls() { // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore
198
199 $draw_icon = $this->check_icon_draw();
200
201 $this->start_controls_section(
202 'premium_button_general_section',
203 array(
204 'label' => __( 'Button', 'premium-addons-for-elementor' ),
205 )
206 );
207
208 $demo = Helper_Functions::get_campaign_link( 'https://premiumaddons.com/elementor-button-widget/', 'button', 'wp-editor', 'demo' );
209 Helper_Functions::add_templates_controls( $this, 'button', $demo );
210
211 $this->add_control(
212 'premium_button_text',
213 array(
214 'label' => __( 'Text', 'premium-addons-for-elementor' ),
215 'type' => Controls_Manager::TEXT,
216 'dynamic' => array( 'active' => true ),
217 'default' => __( 'Premium Addons', 'premium-addons-for-elementor' ),
218 'label_block' => true,
219 )
220 );
221
222 $this->add_control(
223 'premium_button_link_selection',
224 array(
225 'label' => __( 'Link Type', 'premium-addons-for-elementor' ),
226 'type' => Controls_Manager::SELECT,
227 'options' => array(
228 'url' => __( 'URL', 'premium-addons-for-elementor' ),
229 'link' => __( 'Existing Page', 'premium-addons-for-elementor' ),
230 ),
231 'default' => 'url',
232 'label_block' => true,
233 )
234 );
235
236 $this->add_control(
237 'premium_button_link',
238 array(
239 'label' => __( 'Link', 'premium-addons-for-elementor' ),
240 'type' => Controls_Manager::URL,
241 'dynamic' => array( 'active' => true ),
242 'default' => array(
243 'url' => '#',
244 ),
245 'placeholder' => 'https://premiumaddons.com/',
246 'label_block' => true,
247 'condition' => array(
248 'premium_button_link_selection' => 'url',
249 ),
250 )
251 );
252
253 $this->add_control(
254 'premium_button_existing_link',
255 array(
256 'label' => __( 'Existing Page', 'premium-addons-for-elementor' ),
257 'type' => Premium_Post_Filter::TYPE,
258 'label_block' => true,
259 'multiple' => false,
260 'source' => array( 'post', 'page' ),
261 'condition' => array(
262 'premium_button_link_selection' => 'link',
263 ),
264 )
265 );
266
267 $this->add_control(
268 'premium_button_hover_effect',
269 array(
270 'label' => __( 'Hover Effect', 'premium-addons-for-elementor' ),
271 'type' => Controls_Manager::SELECT,
272 'default' => 'none',
273 'options' => array(
274 'none' => __( 'None', 'premium-addons-for-elementor' ),
275 'style1' => __( 'Slide', 'premium-addons-for-elementor' ),
276 'style2' => __( 'Shutter', 'premium-addons-for-elementor' ),
277 'style3' => __( 'Icon Fade', 'premium-addons-for-elementor' ),
278 'style4' => __( 'Icon Slide', 'premium-addons-for-elementor' ),
279 'style5' => __( 'In & Out', 'premium-addons-for-elementor' ),
280 'style6' => __( 'Grow', 'premium-addons-for-elementor' ),
281 'style7' => __( 'Double Layers', 'premium-addons-for-elementor' ),
282 'style8' => __( 'Animated Underline', 'premium-addons-for-elementor' ),
283 ),
284 'separator' => 'before',
285 'label_block' => true,
286 )
287 );
288
289 $this->add_control(
290 'underline_style',
291 array(
292 'label' => __( 'Underline Style', 'premium-addons-for-elementor' ),
293 'type' => Controls_Manager::SELECT,
294 'default' => 'line1',
295 'options' => array(
296 'line1' => __( 'Style 1', 'premium-addons-for-elementor' ),
297 'line2' => __( 'Style 2', 'premium-addons-for-elementor' ),
298 'line3' => __( 'Style 3', 'premium-addons-for-elementor' ),
299 'line4' => __( 'Style 4', 'premium-addons-for-elementor' ),
300 'line5' => __( 'Style 5', 'premium-addons-for-elementor' ),
301 'line6' => __( 'Style 6', 'premium-addons-for-elementor' ),
302 'line7' => __( 'Style 7', 'premium-addons-for-elementor' ),
303 ),
304 'condition' => array(
305 'premium_button_hover_effect' => 'style8',
306 ),
307 'label_block' => true,
308 )
309 );
310
311 $this->add_responsive_control(
312 'line_width',
313 array(
314 'label' => __( 'Line Width (%)', 'premium-addons-for-elementor' ),
315 'type' => Controls_Manager::SLIDER,
316 'condition' => array(
317 'premium_button_hover_effect' => 'style8',
318 'underline_style' => array( 'line1', 'line3', 'line5' ),
319 ),
320 'default' => array(
321 'size' => 100,
322 ),
323 'selectors' => array(
324 '{{WRAPPER}} .premium-btn-svg, {{WRAPPER}} .premium-button-line5::before, {{WRAPPER}} .premium-button-line5::after' => 'width: {{SIZE}}%',
325 ),
326 )
327 );
328
329 $this->add_responsive_control(
330 'line_height',
331 array(
332 'label' => __( 'Line Height (PX)', 'premium-addons-for-elementor' ),
333 'type' => Controls_Manager::SLIDER,
334 'condition' => array(
335 'premium_button_hover_effect' => 'style8',
336 'underline_style!' => array( 'line1', 'line3', 'line4' ),
337 ),
338 'selectors' => array(
339 '{{WRAPPER}} .premium-button-line2::before, {{WRAPPER}} .premium-button-line5::before, {{WRAPPER}} .premium-button-line5::after, {{WRAPPER}} .premium-button-line6::before, {{WRAPPER}} .premium-button-line7::before' => 'height: {{SIZE}}px',
340 ),
341 )
342 );
343
344 $this->add_responsive_control(
345 'line_h_position',
346 array(
347 'label' => __( 'Line Horizontal Position (%)', 'premium-addons-for-elementor' ),
348 'type' => Controls_Manager::SLIDER,
349 'condition' => array(
350 'premium_button_hover_effect' => 'style8',
351 'underline_style' => array( 'line3', 'line5' ),
352 ),
353 'selectors' => array(
354 '{{WRAPPER}} .premium-btn-line-wrap, {{WRAPPER}} .premium-button-line5::before, {{WRAPPER}} .premium-button-line5::after' => 'left: {{SIZE}}%',
355 ),
356 )
357 );
358
359 $this->add_responsive_control(
360 'line_v_position',
361 array(
362 'label' => __( 'Line Vertical Position (%)', 'premium-addons-for-elementor' ),
363 'type' => Controls_Manager::SLIDER,
364 'condition' => array(
365 'premium_button_hover_effect' => 'style8',
366 ),
367 'selectors' => array(
368 '{{WRAPPER}} .premium-btn-line-wrap, {{WRAPPER}} .premium-button-line2::before, {{WRAPPER}} .premium-button-line5::before, {{WRAPPER}} .premium-button-line6::before, {{WRAPPER}} .premium-button-line7::before' => 'top: {{SIZE}}%',
369 '{{WRAPPER}} .premium-button-line5::after' => 'top: calc( ( {{SIZE}}% + 2px ) + {{line_height.SIZE}}px )',
370 ),
371 )
372 );
373
374 $this->add_control(
375 'premium_button_style1_dir',
376 array(
377 'label' => __( 'Slide Direction', 'premium-addons-for-elementor' ),
378 'type' => Controls_Manager::SELECT,
379 'default' => 'bottom',
380 'options' => array(
381 'bottom' => __( 'Top to Bottom', 'premium-addons-for-elementor' ),
382 'top' => __( 'Bottom to Top', 'premium-addons-for-elementor' ),
383 'left' => __( 'Right to Left', 'premium-addons-for-elementor' ),
384 'right' => __( 'Left to Right', 'premium-addons-for-elementor' ),
385 ),
386 'condition' => array(
387 'premium_button_hover_effect' => 'style1',
388 ),
389 'label_block' => true,
390 )
391 );
392
393 $this->add_control(
394 'premium_button_style2_dir',
395 array(
396 'label' => __( 'Shutter Direction', 'premium-addons-for-elementor' ),
397 'type' => Controls_Manager::SELECT,
398 'default' => 'shutouthor',
399 'options' => array(
400 'shutinhor' => __( 'Shutter in Horizontal', 'premium-addons-for-elementor' ),
401 'shutinver' => __( 'Shutter in Vertical', 'premium-addons-for-elementor' ),
402 'shutoutver' => __( 'Shutter out Horizontal', 'premium-addons-for-elementor' ),
403 'shutouthor' => __( 'Shutter out Vertical', 'premium-addons-for-elementor' ),
404 'scshutoutver' => __( 'Scaled Shutter Vertical', 'premium-addons-for-elementor' ),
405 'scshutouthor' => __( 'Scaled Shutter Horizontal', 'premium-addons-for-elementor' ),
406 'dshutinver' => __( 'Tilted Left', 'premium-addons-for-elementor' ),
407 'dshutinhor' => __( 'Tilted Right', 'premium-addons-for-elementor' ),
408 ),
409 'condition' => array(
410 'premium_button_hover_effect' => 'style2',
411 ),
412 'label_block' => true,
413 )
414 );
415
416 $this->add_control(
417 'premium_button_style4_dir',
418 array(
419 'label' => __( 'Slide Direction', 'premium-addons-for-elementor' ),
420 'type' => Controls_Manager::SELECT,
421 'default' => 'bottom',
422 'options' => array(
423 'top' => __( 'Bottom to Top', 'premium-addons-for-elementor' ),
424 'bottom' => __( 'Top to Bottom', 'premium-addons-for-elementor' ),
425 'left' => __( 'Left to Right', 'premium-addons-for-elementor' ),
426 'right' => __( 'Right to Left', 'premium-addons-for-elementor' ),
427 ),
428 'label_block' => true,
429 'condition' => array(
430 'premium_button_hover_effect' => array( 'style4', 'style7' ),
431 ),
432 )
433 );
434
435 $this->add_control(
436 'premium_button_style5_dir',
437 array(
438 'label' => __( 'Style', 'premium-addons-for-elementor' ),
439 'type' => Controls_Manager::SELECT,
440 'default' => 'radialin',
441 'options' => array(
442 'radialin' => __( 'Radial In', 'premium-addons-for-elementor' ),
443 'radialout' => __( 'Radial Out', 'premium-addons-for-elementor' ),
444 'rectin' => __( 'Rectangle In', 'premium-addons-for-elementor' ),
445 'rectout' => __( 'Rectangle Out', 'premium-addons-for-elementor' ),
446 ),
447 'condition' => array(
448 'premium_button_hover_effect' => 'style5',
449 ),
450 'label_block' => true,
451 )
452 );
453
454 $this->add_responsive_control(
455 'grow_size',
456 array(
457 'label' => __( 'Grow Layer Size', 'premium-addons-for-elementor' ),
458 'type' => Controls_Manager::SLIDER,
459 'range' => array(
460 'px' => array(
461 'min' => 0,
462 'max' => 500,
463 ),
464 ),
465 'condition' => array(
466 'premium_button_hover_effect' => 'style6',
467 'mouse_detect!' => 'yes',
468 ),
469 'selectors' => array(
470 '{{WRAPPER}} .premium-button.premium-button-style6:before' => 'width: {{SIZE}}px; height: {{SIZE}}px',
471 ),
472 )
473 );
474
475 $this->add_control(
476 'grow_speed',
477 array(
478 'label' => __( 'Grow Animation Speed (Sec)', 'premium-addons-for-elementor' ),
479 'type' => Controls_Manager::SLIDER,
480 'range' => array(
481 'px' => array(
482 'min' => 0,
483 'max' => 3,
484 'step' => 0.1,
485 ),
486 ),
487 'condition' => array(
488 'premium_button_hover_effect' => 'style6',
489 'mouse_detect!' => 'yes',
490 ),
491 'selectors' => array(
492 '{{WRAPPER}} .premium-button.premium-button-style6:before' => 'transition-duration: {{SIZE}}s',
493 ),
494 )
495 );
496
497 $this->add_control(
498 'mouse_detect',
499 array(
500 'label' => __( 'Detect Mouse Position', 'premium-addons-for-elementor' ),
501 'type' => Controls_Manager::SWITCHER,
502 'prefix_class' => 'premium-mouse-detect-',
503 'render_type' => 'template',
504 'separator' => 'after',
505 'condition' => array(
506 'premium_button_hover_effect' => 'style6',
507 ),
508 )
509 );
510
511 $this->add_control(
512 'premium_button_icon_switcher',
513 array(
514 'label' => __( 'Icon', 'premium-addons-for-elementor' ),
515 'type' => Controls_Manager::SWITCHER,
516 'description' => __( 'Enable or disable button icon', 'premium-addons-for-elementor' ),
517 'condition' => array(
518 'premium_button_hover_effect!' => 'style4',
519 ),
520 )
521 );
522
523 $common_conditions = array(
524 'premium_button_icon_switcher' => 'yes',
525 'premium_button_hover_effect!' => 'style4',
526 );
527
528 $this->add_control(
529 'icon_type',
530 array(
531 'label' => __( 'Icon Type', 'premium-addons-for-elementor' ),
532 'type' => Controls_Manager::SELECT,
533 'options' => array(
534 'icon' => __( 'Icon', 'premium-addons-for-elementor' ),
535 'animation' => __( 'Lottie Animation', 'premium-addons-for-elementor' ),
536 'svg' => __( 'SVG Code', 'premium-addons-for-elementor' ),
537 ),
538 'default' => 'icon',
539 'label_block' => true,
540 'condition' => $common_conditions,
541 )
542 );
543
544 $this->add_control(
545 'premium_button_icon_selection_updated',
546 array(
547 'label' => __( 'Icon', 'premium-addons-for-elementor' ),
548 'type' => Controls_Manager::ICONS,
549 'fa4compatibility' => 'premium_button_icon_selection',
550 'default' => array(
551 'value' => 'fas fa-star',
552 'library' => 'fa-solid',
553 ),
554 'condition' => array_merge(
555 $common_conditions,
556 array(
557 'icon_type' => 'icon',
558 )
559 ),
560 'label_block' => true,
561 )
562 );
563
564 $this->add_control(
565 'custom_svg',
566 array(
567 'label' => __( 'SVG Code', 'premium-addons-for-elementor' ),
568 'type' => Controls_Manager::TEXTAREA,
569 'description' => 'You can use these sites to create SVGs: <a href="https://danmarshall.github.io/google-font-to-svg-path/" target="_blank">Google Fonts</a> and <a href="https://boxy-svg.com/" target="_blank">Boxy SVG</a>',
570 'condition' => array_merge(
571 $common_conditions,
572 array(
573 'icon_type' => 'svg',
574 )
575 ),
576 'ai' => array(
577 'active' => false,
578 ),
579 )
580 );
581
582 $this->add_control(
583 'lottie_url',
584 array(
585 'label' => __( 'Animation JSON URL', 'premium-addons-for-elementor' ),
586 'type' => Controls_Manager::TEXT,
587 'dynamic' => array( 'active' => true ),
588 'description' => 'Get JSON code URL from <a href="https://lottiefiles.com/" target="_blank">here</a>',
589 'label_block' => true,
590 'condition' => array_merge(
591 $common_conditions,
592 array(
593 'icon_type' => 'animation',
594 )
595 ),
596 'ai' => array(
597 'active' => false,
598 ),
599 )
600 );
601
602 $animation_conds = array(
603 'terms' => array(
604 array(
605 'name' => 'premium_button_icon_switcher',
606 'value' => 'yes',
607 ),
608 array(
609 'name' => 'premium_button_hover_effect',
610 'operator' => '!==',
611 'value' => 'style4',
612 ),
613 array(
614 'relation' => 'or',
615 'terms' => array(
616 array(
617 'name' => 'icon_type',
618 'value' => 'animation',
619 ),
620 array(
621 'terms' => array(
622 array(
623 'relation' => 'or',
624 'terms' => array(
625 array(
626 'name' => 'icon_type',
627 'value' => 'icon',
628 ),
629 array(
630 'name' => 'icon_type',
631 'value' => 'svg',
632 ),
633 ),
634 ),
635 array(
636 'name' => 'draw_svg',
637 'value' => 'yes',
638 ),
639 ),
640 ),
641 ),
642 ),
643 ),
644 );
645
646 $this->add_control(
647 'draw_svg',
648 array(
649 'label' => __( 'Draw Icon', 'premium-addons-for-elementor' ),
650 'type' => Controls_Manager::SWITCHER,
651 'description' => __( 'Enable this option to make the icon drawable. See ', 'premium-addons-for-elementor' ) . '<a href="https://www.youtube.com/watch?v=ZLr0bRe0RAY" target="_blank">tutorial</a>',
652 'classes' => $draw_icon ? '' : 'editor-pa-control-disabled',
653 'condition' => array_merge(
654 $common_conditions,
655 array(
656 'icon_type' => array( 'icon', 'svg' ),
657 'premium_button_icon_selection_updated[library]!' => 'svg',
658 )
659 ),
660 )
661 );
662
663 if ( $draw_icon ) {
664
665 $this->add_control(
666 'stroke_width',
667 array(
668 'label' => __( 'Path Thickness', 'premium-addons-for-elementor' ),
669 'type' => Controls_Manager::SLIDER,
670 'range' => array(
671 'px' => array(
672 'min' => 0,
673 'max' => 50,
674 'step' => 0.1,
675 ),
676 ),
677 'condition' => array_merge(
678 $common_conditions,
679 array(
680 'icon_type' => array( 'icon', 'svg' ),
681 )
682 ),
683 'selectors' => array(
684 '{{WRAPPER}} .premium-button-text-icon-wrapper svg:not(.premium-btn-svg) *' => 'stroke-width: {{SIZE}}',
685 ),
686 )
687 );
688
689 $this->add_control(
690 'svg_sync',
691 array(
692 'label' => __( 'Draw All Paths Together', 'premium-addons-for-elementor' ),
693 'type' => Controls_Manager::SWITCHER,
694 'condition' => array_merge(
695 $common_conditions,
696 array(
697 'icon_type' => array( 'icon', 'svg' ),
698 'draw_svg' => 'yes',
699 )
700 ),
701 )
702 );
703
704 $this->add_control(
705 'frames',
706 array(
707 'label' => __( 'Speed', 'premium-addons-for-elementor' ),
708 'type' => Controls_Manager::NUMBER,
709 'description' => __( 'Larger value means longer animation duration.', 'premium-addons-for-elementor' ),
710 'default' => 5,
711 'min' => 1,
712 'max' => 100,
713 'condition' => array_merge(
714 $common_conditions,
715 array(
716 'icon_type' => array( 'icon', 'svg' ),
717 'draw_svg' => 'yes',
718 )
719 ),
720 )
721 );
722
723 } else {
724
725 Helper_Functions::get_draw_svg_notice(
726 $this,
727 'button',
728 array_merge(
729 $common_conditions,
730 array(
731 'icon_type' => array( 'icon', 'svg' ),
732 'premium_button_icon_selection_updated[library]!' => 'svg',
733 )
734 )
735 );
736
737 }
738
739 $this->add_control(
740 'lottie_loop',
741 array(
742 'label' => __( 'Loop', 'premium-addons-for-elementor' ),
743 'type' => Controls_Manager::SWITCHER,
744 'return_value' => 'true',
745 'default' => 'true',
746 'conditions' => $animation_conds,
747 )
748 );
749
750 $this->add_control(
751 'lottie_reverse',
752 array(
753 'label' => __( 'Reverse', 'premium-addons-for-elementor' ),
754 'type' => Controls_Manager::SWITCHER,
755 'return_value' => 'true',
756 'conditions' => $animation_conds,
757 )
758 );
759
760 if ( $draw_icon ) {
761 $this->add_control(
762 'start_point',
763 array(
764 'label' => __( 'Start Point (%)', 'premium-addons-for-elementor' ),
765 'type' => Controls_Manager::SLIDER,
766 'description' => __( 'Set the point that the SVG should start from.', 'premium-addons-for-elementor' ),
767 'default' => array(
768 'unit' => '%',
769 'size' => 0,
770 ),
771 'condition' => array_merge(
772 $common_conditions,
773 array(
774 'icon_type' => array( 'icon', 'svg' ),
775 'draw_svg' => 'yes',
776 'lottie_reverse!' => 'true',
777 )
778 ),
779 )
780 );
781
782 $this->add_control(
783 'end_point',
784 array(
785 'label' => __( 'End Point (%)', 'premium-addons-for-elementor' ),
786 'type' => Controls_Manager::SLIDER,
787 'description' => __( 'Set the point that the SVG should end at.', 'premium-addons-for-elementor' ),
788 'default' => array(
789 'unit' => '%',
790 'size' => 0,
791 ),
792 'condition' => array_merge(
793 $common_conditions,
794 array(
795 'icon_type' => array( 'icon', 'svg' ),
796 'draw_svg' => 'yes',
797 'lottie_reverse' => 'true',
798 )
799 ),
800
801 )
802 );
803
804 }
805
806 $this->add_control(
807 'svg_hover',
808 array(
809 'label' => __( 'Only Play on Hover', 'premium-addons-for-elementor' ),
810 'type' => Controls_Manager::SWITCHER,
811 'return_value' => 'true',
812 'conditions' => $animation_conds,
813 )
814 );
815
816 if ( $draw_icon ) {
817
818 $this->add_control(
819 'svg_yoyo',
820 array(
821 'label' => __( 'Yoyo Effect', 'premium-addons-for-elementor' ),
822 'type' => Controls_Manager::SWITCHER,
823 'condition' => array_merge(
824 $common_conditions,
825 array(
826 'icon_type' => array( 'icon', 'svg' ),
827 'draw_svg' => 'yes',
828 'lottie_loop' => 'true',
829 )
830 ),
831 )
832 );
833 }
834
835 $this->add_control(
836 'slide_icon_type',
837 array(
838 'label' => __( 'Icon Type', 'premium-addons-for-elementor' ),
839 'type' => Controls_Manager::SELECT,
840 'options' => array(
841 'icon' => __( 'Icon', 'premium-addons-for-elementor' ),
842 'animation' => __( 'Lottie Animation', 'premium-addons-for-elementor' ),
843 ),
844 'default' => 'icon',
845 'label_block' => true,
846 'condition' => array(
847 'premium_button_hover_effect' => 'style4',
848 ),
849 )
850 );
851
852 $this->add_control(
853 'premium_button_style4_icon_selection_updated',
854 array(
855 'label' => __( 'Icon', 'premium-addons-for-elementor' ),
856 'type' => Controls_Manager::ICONS,
857 'fa4compatibility' => 'premium_button_style4_icon_selection',
858 'default' => array(
859 'value' => 'fas fa-bars',
860 'library' => 'fa-solid',
861 ),
862 'condition' => array(
863 'slide_icon_type' => 'icon',
864 'premium_button_hover_effect' => 'style4',
865 ),
866 'label_block' => true,
867 )
868 );
869
870 $this->add_control(
871 'slide_lottie_url',
872 array(
873 'label' => __( 'Animation JSON URL', 'premium-addons-for-elementor' ),
874 'type' => Controls_Manager::TEXT,
875 'dynamic' => array( 'active' => true ),
876 'description' => 'Get JSON code URL from <a href="https://lottiefiles.com/" target="_blank">here</a>',
877 'label_block' => true,
878 'condition' => array(
879 'slide_icon_type' => 'animation',
880 'premium_button_hover_effect' => 'style4',
881 ),
882 'ai' => array(
883 'active' => false,
884 ),
885 )
886 );
887
888 $this->add_control(
889 'premium_button_icon_position',
890 array(
891 'label' => __( 'Icon Position', 'premium-addons-for-elementor' ),
892 'type' => Controls_Manager::SELECT,
893 'prefix_class' => 'pa-icon-pos-',
894 'default' => 'before',
895 'options' => array(
896 'before' => __( 'Before', 'premium-addons-for-elementor' ),
897 'after' => __( 'After', 'premium-addons-for-elementor' ),
898 ),
899 'label_block' => true,
900 'condition' => array(
901 'premium_button_icon_switcher' => 'yes',
902 'premium_button_hover_effect!' => 'style4',
903 ),
904 'selectors_dictionary' => array(
905 'before' => 'row',
906 'after' => 'row-reverse',
907 ),
908 'selectors' => array(
909 '{{WRAPPER}} .premium-button-text-icon-wrapper' => 'flex-direction: {{VALUE}}',
910 ),
911 )
912 );
913
914 $this->add_responsive_control(
915 'premium_button_icon_before_size',
916 array(
917 'label' => __( 'Icon Size', 'premium-addons-for-elementor' ),
918 'type' => Controls_Manager::SLIDER,
919 'size_units' => array( 'px', 'em', 'vw' ),
920 'range' => array(
921 'px' => array(
922 'min' => 0,
923 'max' => 200,
924 ),
925 ),
926 'condition' => array(
927 'premium_button_icon_switcher' => 'yes',
928 'premium_button_hover_effect!' => 'style4',
929 ),
930 'selectors' => array(
931 '{{WRAPPER}} .premium-button-text-icon-wrapper i' => 'font-size: {{SIZE}}{{UNIT}}',
932 '{{WRAPPER}} .premium-button-text-icon-wrapper svg' => 'width: {{SIZE}}{{UNIT}} !important; height: {{SIZE}}{{UNIT}} !important',
933 ),
934 )
935 );
936
937 $this->add_responsive_control(
938 'premium_button_icon_style4_size',
939 array(
940 'label' => __( 'Icon Size', 'premium-addons-for-elementor' ),
941 'type' => Controls_Manager::SLIDER,
942 'size_units' => array( 'px', 'em', 'vw' ),
943 'condition' => array(
944 'premium_button_hover_effect' => 'style4',
945 ),
946 'selectors' => array(
947 '{{WRAPPER}} .premium-button-style4-icon-wrapper i' => 'font-size: {{SIZE}}{{UNIT}}',
948 '{{WRAPPER}} .premium-button-style4-icon-wrapper svg' => 'width: {{SIZE}}{{UNIT}} !important; height: {{SIZE}}{{UNIT}} !important',
949 ),
950 )
951 );
952
953 $this->add_responsive_control(
954 'premium_button_icon_before_spacing',
955 array(
956 'label' => __( 'Icon Spacing', 'premium-addons-for-elementor' ),
957 'type' => Controls_Manager::SLIDER,
958 'condition' => array(
959 'premium_button_icon_switcher' => 'yes',
960 'premium_button_hover_effect!' => array( 'style3', 'style4' ),
961 ),
962 'default' => array(
963 'size' => 15,
964 ),
965 'selectors' => array(
966 '{{WRAPPER}} .premium-button-text-icon-wrapper' => 'gap: {{SIZE}}px',
967 '{{WRAPPER}}.pa-icon-pos-before' => '--pa-btn-line6-translate-x: {{SIZE}}px',
968 '{{WRAPPER}}.pa-icon-pos-after' => '--pa-btn-line6-translate-x: -{{SIZE}}px',
969 ),
970 'separator' => 'after',
971 )
972 );
973
974 $this->add_responsive_control(
975 'premium_button_icon_style3_before_transition',
976 array(
977 'label' => __( 'Icon Spacing', 'premium-addons-for-elementor' ),
978 'type' => Controls_Manager::SLIDER,
979 'condition' => array(
980 'premium_button_icon_switcher' => 'yes',
981 // 'premium_button_icon_position' => 'before',
982 'premium_button_hover_effect' => 'style3',
983 ),
984 'range' => array(
985 'px' => array(
986 'min' => -50,
987 'max' => 50,
988 ),
989 ),
990 'selectors' => array(
991 '{{WRAPPER}} .premium-button-style3:hover i, {{WRAPPER}} .premium-button-style3:hover svg' => '-webkit-transform: translateX({{SIZE}}{{UNIT}}); transform: translateX({{SIZE}}{{UNIT}})',
992 ),
993 )
994 );
995
996 $this->add_control(
997 'slide_lottie_loop',
998 array(
999 'label' => __( 'Loop', 'premium-addons-for-elementor' ),
1000 'type' => Controls_Manager::SWITCHER,
1001 'return_value' => 'true',
1002 'default' => 'true',
1003 'condition' => array(
1004 'slide_icon_type' => 'animation',
1005 'premium_button_hover_effect' => 'style4',
1006 ),
1007 )
1008 );
1009
1010 $this->add_control(
1011 'slide_lottie_reverse',
1012 array(
1013 'label' => __( 'Reverse', 'premium-addons-for-elementor' ),
1014 'type' => Controls_Manager::SWITCHER,
1015 'return_value' => 'true',
1016 'condition' => array(
1017 'slide_icon_type' => 'animation',
1018 'premium_button_hover_effect' => 'style4',
1019 ),
1020 )
1021 );
1022
1023 $this->add_control(
1024 'premium_button_size',
1025 array(
1026 'label' => __( 'Size', 'premium-addons-for-elementor' ),
1027 'type' => Controls_Manager::SELECT,
1028 'default' => 'lg',
1029 'options' => array(
1030 'sm' => __( 'Small', 'premium-addons-for-elementor' ),
1031 'md' => __( 'Medium', 'premium-addons-for-elementor' ),
1032 'lg' => __( 'Large', 'premium-addons-for-elementor' ),
1033 'block' => __( 'Block', 'premium-addons-for-elementor' ),
1034 ),
1035 'label_block' => true,
1036 'separator' => 'before',
1037 )
1038 );
1039
1040 $this->add_responsive_control(
1041 'premium_button_align',
1042 array(
1043 'label' => __( 'Alignment', 'premium-addons-for-elementor' ),
1044 'type' => Controls_Manager::CHOOSE,
1045 'options' => array(
1046 'left' => array(
1047 'title' => __( 'Left', 'premium-addons-for-elementor' ),
1048 'icon' => 'eicon-text-align-left',
1049 ),
1050 'center' => array(
1051 'title' => __( 'Center', 'premium-addons-for-elementor' ),
1052 'icon' => 'eicon-text-align-center',
1053 ),
1054 'right' => array(
1055 'title' => __( 'Right', 'premium-addons-for-elementor' ),
1056 'icon' => 'eicon-text-align-right',
1057 ),
1058 ),
1059 'selectors' => array(
1060 '{{WRAPPER}}' => 'text-align: {{VALUE}}',
1061 ),
1062 'toggle' => false,
1063 'default' => 'center',
1064 'condition' => array(
1065 'premium_button_size!' => 'block',
1066 ),
1067 )
1068 );
1069
1070 // Allow admins only to add JS.
1071 if ( current_user_can( 'administrator' ) ) {
1072 $this->add_control(
1073 'premium_button_event_switcher',
1074 array(
1075 'label' => __( 'onclick Event', 'premium-addons-for-elementor' ),
1076 'type' => Controls_Manager::SWITCHER,
1077 )
1078 );
1079
1080 $this->add_control(
1081 'premium_button_event_function',
1082 array(
1083 'label' => __( 'Example: myFunction();', 'premium-addons-for-elementor' ),
1084 'type' => Controls_Manager::CODE,
1085 'dynamic' => array( 'active' => true ),
1086 'condition' => array(
1087 'premium_button_event_switcher' => 'yes',
1088 ),
1089 )
1090 );
1091
1092 }
1093
1094 $this->end_controls_section();
1095
1096 $this->start_controls_section(
1097 'section_pa_docs',
1098 array(
1099 'label' => __( 'Help & Docs', 'premium-addons-for-elementor' ),
1100 )
1101 );
1102
1103 $docs = array(
1104 'https://premiumaddons.com/docs/button-widget-tutorial' => __( 'Getting started »', 'premium-addons-for-elementor' ),
1105 'https://premiumaddons.com/docs/how-can-i-open-an-elementor-popup-using-premium-button' => __( 'How to open an Elementor popup using button widget »', 'premium-addons-for-elementor' ),
1106 'https://premiumaddons.com/docs/how-to-play-pause-a-soundtrack-using-premium-button-widget' => __( 'How to play/pause a soundtrack using button widget »', 'premium-addons-for-elementor' ),
1107 'https://premiumaddons.com/docs/how-to-use-elementor-widgets-to-navigate-through-carousel-widget-slides/' => __( 'How To Use Premium Button To Navigate Through Carousel Widget Slides »', 'premium-addons-for-elementor' ),
1108 );
1109
1110 $doc_index = 1;
1111 foreach ( $docs as $url => $title ) {
1112
1113 $doc_url = Helper_Functions::get_campaign_link( $url, 'button-widget', 'wp-editor', 'get-support' );
1114
1115 $this->add_control(
1116 'doc_' . $doc_index,
1117 array(
1118 'type' => Controls_Manager::RAW_HTML,
1119 'raw' => sprintf( '<a href="%s" target="_blank">%s</a>', $doc_url, $title ),
1120 'content_classes' => 'editor-pa-doc',
1121 )
1122 );
1123
1124 ++$doc_index;
1125
1126 }
1127
1128 Helper_Functions::register_element_feedback_controls( $this );
1129
1130 $this->end_controls_section();
1131
1132 Helper_Functions::register_papro_promotion_controls( $this, 'button' );
1133
1134 $this->start_controls_section(
1135 'premium_button_style_section',
1136 array(
1137 'label' => __( 'Button', 'premium-addons-for-elementor' ),
1138 'tab' => Controls_Manager::TAB_STYLE,
1139 )
1140 );
1141
1142 $this->add_responsive_control(
1143 'button_width',
1144 array(
1145 'label' => __( 'Width', 'premium-addons-for-elementor' ),
1146 'type' => Controls_Manager::SLIDER,
1147 'size_units' => array( 'px', '%', 'vw', 'custom' ),
1148 'range' => array(
1149 'px' => array(
1150 'min' => 1,
1151 'max' => 500,
1152 ),
1153 ),
1154 'selectors' => array(
1155 '{{WRAPPER}} .premium-button' => 'width: {{SIZE}}{{UNIT}};',
1156 ),
1157 'condition' => array(
1158 'premium_button_size!' => 'block',
1159 ),
1160 )
1161 );
1162
1163 if ( $draw_icon ) {
1164 $this->add_control(
1165 'svg_color',
1166 array(
1167 'label' => __( 'After Draw Fill Color', 'premium-addons-for-elementor' ),
1168 'type' => Controls_Manager::COLOR,
1169 'global' => false,
1170 'separator' => 'after',
1171 'condition' => array(
1172 'premium_button_icon_switcher' => 'yes',
1173 'icon_type' => array( 'icon', 'svg' ),
1174 'premium_button_hover_effect!' => 'style4',
1175 'draw_svg' => 'yes',
1176 ),
1177 )
1178 );
1179 }
1180
1181 $this->add_group_control(
1182 Group_Control_Typography::get_type(),
1183 array(
1184 'name' => 'premium_button_typo',
1185 'global' => array(
1186 'default' => Global_Typography::TYPOGRAPHY_PRIMARY,
1187 ),
1188 'selector' => '{{WRAPPER}} .premium-button .premium-button-text-icon-wrapper span',
1189 )
1190 );
1191
1192 $this->start_controls_tabs( 'premium_button_style_tabs' );
1193
1194 $this->start_controls_tab(
1195 'premium_button_style_normal',
1196 array(
1197 'label' => __( 'Normal', 'premium-addons-for-elementor' ),
1198 )
1199 );
1200
1201 $this->add_control(
1202 'premium_button_text_color_normal',
1203 array(
1204 'label' => __( 'Text Color', 'premium-addons-for-elementor' ),
1205 'type' => Controls_Manager::COLOR,
1206 'global' => array(
1207 'default' => Global_Colors::COLOR_SECONDARY,
1208 ),
1209 'selectors' => array(
1210 '{{WRAPPER}} .premium-button .premium-button-text-icon-wrapper span' => 'color: {{VALUE}};',
1211 ),
1212 )
1213 );
1214
1215 $this->add_control(
1216 'premium_button_icon_color_normal',
1217 array(
1218 'label' => __( 'Icon Color', 'premium-addons-for-elementor' ),
1219 'type' => Controls_Manager::COLOR,
1220 'global' => array(
1221 'default' => Global_Colors::COLOR_SECONDARY,
1222 ),
1223 'selectors' => array(
1224 '{{WRAPPER}} .premium-button-text-icon-wrapper i' => 'color: {{VALUE}}',
1225 '{{WRAPPER}} .premium-drawable-icon *, {{WRAPPER}} .premium-button-text-icon-wrapper svg:not([class*="premium-"])' => 'fill: {{VALUE}};',
1226 ),
1227 'condition' => array(
1228 'premium_button_icon_switcher' => 'yes',
1229 'icon_type' => array( 'icon', 'svg' ),
1230 'premium_button_hover_effect!' => array( 'style3', 'style4' ),
1231 ),
1232 )
1233 );
1234
1235 if ( $draw_icon ) {
1236 $this->add_control(
1237 'stroke_color',
1238 array(
1239 'label' => __( 'Stroke Color', 'premium-addons-for-elementor' ),
1240 'type' => Controls_Manager::COLOR,
1241 'global' => array(
1242 'default' => Global_Colors::COLOR_ACCENT,
1243 ),
1244 'condition' => array(
1245 'premium_button_icon_switcher' => 'yes',
1246 'icon_type' => array( 'icon', 'svg' ),
1247 'premium_button_hover_effect!' => array( 'style3', 'style4' ),
1248 ),
1249 'selectors' => array(
1250 // Drawable SVG icons
1251 '{{WRAPPER}} .premium-drawable-icon *' => 'stroke: {{VALUE}};',
1252 // Normal SVG icons (exclude Lottie SVGs)
1253 '{{WRAPPER}} svg:not(.premium-lottie-animation):not(.premium-lottie-animation svg)' => 'stroke: {{VALUE}};',
1254 ),
1255 )
1256 );
1257 }
1258
1259 $this->add_control(
1260 'premium_button_background_normal',
1261 array(
1262 'label' => __( 'Background Color', 'premium-addons-for-elementor' ),
1263 'type' => Controls_Manager::COLOR,
1264 'global' => array(
1265 'default' => Global_Colors::COLOR_PRIMARY,
1266 ),
1267 'selectors' => array(
1268 '{{WRAPPER}} .premium-button, {{WRAPPER}} .premium-button.premium-button-style2-shutinhor:before , {{WRAPPER}} .premium-button.premium-button-style2-shutinver:before , {{WRAPPER}} .premium-button-style5-radialin:before , {{WRAPPER}} .premium-button-style5-rectin:before' => 'background-color: {{VALUE}};',
1269 ),
1270 )
1271 );
1272
1273 $this->add_control(
1274 'btn_lq_effect',
1275 array(
1276 'label' => __( 'Liquid Glass Effect', 'premium-addons-for-elementor' ),
1277 'type' => Controls_Manager::SELECT,
1278 'description' => sprintf(
1279 /* translators: 1: `<a>` opening tag, 2: `</a>` closing tag. */
1280 esc_html__( 'Important: Make sure this element has a semi-transparent background color to see the effect. See all presets from %1$shere%2$s.', 'premium-addons-for-elementor' ),
1281 '<a href="https://premiumaddons.com/liquid-glass/" target="_blank">',
1282 '</a>'
1283 ),
1284 'options' => array(
1285 'none' => __( 'None', 'premium-addons-for-elementor' ),
1286 'glass1' => __( 'Preset 01', 'premium-addons-for-elementor' ),
1287 'glass2' => __( 'Preset 02', 'premium-addons-for-elementor' ),
1288 'glass3' => apply_filters( 'pa_pro_label', __( 'Preset 03 (Pro)', 'premium-addons-for-elementor' ) ),
1289 'glass4' => apply_filters( 'pa_pro_label', __( 'Preset 04 (Pro)', 'premium-addons-for-elementor' ) ),
1290 'glass5' => apply_filters( 'pa_pro_label', __( 'Preset 05 (Pro)', 'premium-addons-for-elementor' ) ),
1291 'glass6' => apply_filters( 'pa_pro_label', __( 'Preset 06 (Pro)', 'premium-addons-for-elementor' ) ),
1292 ),
1293 'prefix_class' => 'premium-lq__',
1294 'default' => 'none',
1295 'render_type' => 'template',
1296 'label_block' => true,
1297 'condition' => array(
1298 'premium_button_hover_effect!' => array( 'style2', 'style5' ),
1299 ),
1300 )
1301 );
1302
1303 $this->add_group_control(
1304 Group_Control_Border::get_type(),
1305 array(
1306 'name' => 'premium_button_border_normal',
1307 'selector' => '{{WRAPPER}} .premium-button',
1308 )
1309 );
1310
1311 $this->add_control(
1312 'premium_button_border_radius_normal',
1313 array(
1314 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
1315 'type' => Controls_Manager::SLIDER,
1316 'size_units' => array( 'px', '%', 'em' ),
1317 'selectors' => array(
1318 '{{WRAPPER}} .premium-button' => 'border-radius: {{SIZE}}{{UNIT}};',
1319 ),
1320 'condition' => array(
1321 'button_adv_radius!' => 'yes',
1322 ),
1323 )
1324 );
1325
1326 $this->add_control(
1327 'button_adv_radius',
1328 array(
1329 'label' => __( 'Advanced Border Radius', 'premium-addons-for-elementor' ),
1330 'type' => Controls_Manager::SWITCHER,
1331 'description' => __( 'Apply custom radius values. Get the radius value from ', 'premium-addons-for-elementor' ) . '<a href="https://9elements.github.io/fancy-border-radius/" target="_blank">here</a>' . __( '. See ', 'premium-addons-for-elementor' ) . '<a href="https://www.youtube.com/watch?v=S0BJazLHV-M" target="_blank">tutorial</a>',
1332 )
1333 );
1334
1335 $this->add_control(
1336 'button_adv_radius_value',
1337 array(
1338 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
1339 'type' => Controls_Manager::TEXT,
1340 'dynamic' => array( 'active' => true ),
1341 'selectors' => array(
1342 '{{WRAPPER}} .premium-button' => 'border-radius: {{VALUE}};',
1343 ),
1344 'condition' => array(
1345 'button_adv_radius' => 'yes',
1346 ),
1347 'ai' => array(
1348 'active' => false,
1349 ),
1350 )
1351 );
1352
1353 $this->add_group_control(
1354 Group_Control_Text_Shadow::get_type(),
1355 array(
1356 'label' => __( 'Icon Shadow', 'premium-addons-for-elementor' ),
1357 'name' => 'premium_button_icon_shadow_normal',
1358 'selector' => '{{WRAPPER}} .premium-button-text-icon-wrapper i',
1359 'condition' => array(
1360 'premium_button_icon_switcher' => 'yes',
1361 'icon_type' => 'icon',
1362 'premium_button_hover_effect!' => array( 'style3', 'style4' ),
1363 ),
1364 )
1365 );
1366
1367 $this->add_group_control(
1368 Group_Control_Text_Shadow::get_type(),
1369 array(
1370 'label' => __( 'Text Shadow', 'premium-addons-for-elementor' ),
1371 'name' => 'premium_button_text_shadow_normal',
1372 'selector' => '{{WRAPPER}} .premium-button-text-icon-wrapper span',
1373 )
1374 );
1375
1376 $this->add_group_control(
1377 Group_Control_Box_Shadow::get_type(),
1378 array(
1379 'label' => __( 'Button Shadow', 'premium-addons-for-elementor' ),
1380 'name' => 'premium_button_box_shadow_normal',
1381 'selector' => '{{WRAPPER}} .premium-button',
1382 )
1383 );
1384
1385 $this->add_responsive_control(
1386 'premium_button_margin_normal',
1387 array(
1388 'label' => __( 'Margin', 'premium-addons-for-elementor' ),
1389 'type' => Controls_Manager::DIMENSIONS,
1390 'size_units' => array( 'px', 'em', '%', 'vw', 'custom' ),
1391 'selectors' => array(
1392 '{{WRAPPER}} .premium-button' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1393 ),
1394 )
1395 );
1396
1397 $this->add_responsive_control(
1398 'premium_button_padding_normal',
1399 array(
1400 'label' => __( 'Padding', 'premium-addons-for-elementor' ),
1401 'type' => Controls_Manager::DIMENSIONS,
1402 'size_units' => array( 'px', 'em', '%', 'vw', 'custom' ),
1403 'selectors' => array(
1404 '{{WRAPPER}} .premium-button, {{WRAPPER}} .premium-button-line6::after' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1405 ),
1406 )
1407 );
1408
1409 $this->end_controls_tab();
1410
1411 $this->start_controls_tab(
1412 'premium_button_style_hover',
1413 array(
1414 'label' => __( 'Hover', 'premium-addons-for-elementor' ),
1415 )
1416 );
1417
1418 $this->add_control(
1419 'premium_button_text_color_hover',
1420 array(
1421 'label' => __( 'Text Color', 'premium-addons-for-elementor' ),
1422 'type' => Controls_Manager::COLOR,
1423 'global' => array(
1424 'default' => Global_Colors::COLOR_PRIMARY,
1425 ),
1426 'selectors' => array(
1427 '{{WRAPPER}} .premium-button:hover .premium-button-text-icon-wrapper span, {{WRAPPER}} .premium-button-line6::after' => 'color: {{VALUE}};',
1428 ),
1429 'condition' => array(
1430 'premium_button_hover_effect!' => 'style4',
1431 ),
1432 )
1433 );
1434
1435 $this->add_control(
1436 'premium_button_icon_color_hover',
1437 array(
1438 'label' => __( 'Icon Color', 'premium-addons-for-elementor' ),
1439 'type' => Controls_Manager::COLOR,
1440 'global' => array(
1441 'default' => Global_Colors::COLOR_PRIMARY,
1442 ),
1443 'selectors' => array(
1444 '{{WRAPPER}} .premium-button:hover .premium-button-text-icon-wrapper i' => 'color: {{VALUE}}',
1445 '{{WRAPPER}} .premium-button:hover .premium-drawable-icon *, {{WRAPPER}} .premium-button:hover svg:not([class*="premium-"])' => 'fill: {{VALUE}};',
1446 ),
1447 'condition' => array(
1448 'premium_button_icon_switcher' => 'yes',
1449 'icon_type' => array( 'icon', 'svg' ),
1450 'premium_button_hover_effect!' => 'style4',
1451 ),
1452 )
1453 );
1454
1455 $this->add_control(
1456 'underline_color',
1457 array(
1458 'label' => __( 'Line Color', 'premium-addons-for-elementor' ),
1459 'type' => Controls_Manager::COLOR,
1460 'global' => array(
1461 'default' => Global_Colors::COLOR_SECONDARY,
1462 ),
1463 'selectors' => array(
1464 '{{WRAPPER}} .premium-btn-svg' => 'stroke: {{VALUE}};',
1465 '{{WRAPPER}} .premium-button-line2::before, {{WRAPPER}} .premium-button-line4::before, {{WRAPPER}} .premium-button-line5::before, {{WRAPPER}} .premium-button-line5::after, {{WRAPPER}} .premium-button-line6::before, {{WRAPPER}} .premium-button-line7::before' => 'background-color: {{VALUE}};',
1466 ),
1467 'condition' => array(
1468 'premium_button_hover_effect' => 'style8',
1469 ),
1470 )
1471 );
1472
1473 if ( $draw_icon ) {
1474 $this->add_control(
1475 'stroke_color_hover',
1476 array(
1477 'label' => __( 'Stroke Color', 'premium-addons-for-elementor' ),
1478 'type' => Controls_Manager::COLOR,
1479 'global' => array(
1480 'default' => Global_Colors::COLOR_ACCENT,
1481 ),
1482 'condition' => array(
1483 'premium_button_icon_switcher' => 'yes',
1484 'icon_type' => array( 'icon', 'svg' ),
1485 'premium_button_hover_effect!' => 'style4',
1486 ),
1487 'selectors' => array(
1488 // Drawable SVG icons
1489 '{{WRAPPER}} .premium-button:hover .premium-drawable-icon *' => 'stroke: {{VALUE}};',
1490 // Normal SVG icons (exclude Lottie SVGs)
1491 '{{WRAPPER}} .premium-button:hover svg:not(.premium-lottie-animation):not(.premium-lottie-animation svg)' => 'stroke: {{VALUE}};',
1492 ),
1493 )
1494 );
1495 }
1496
1497 $this->add_control(
1498 'premium_button_style4_icon_color',
1499 array(
1500 'label' => __( 'Icon Color', 'premium-addons-for-elementor' ),
1501 'type' => Controls_Manager::COLOR,
1502 'global' => array(
1503 'default' => Global_Colors::COLOR_PRIMARY,
1504 ),
1505 'selectors' => array(
1506 '{{WRAPPER}} .premium-button-style4-icon-wrapper' => 'color: {{VALUE}}',
1507 '{{WRAPPER}} .premium-button-style4-icon-wrapper svg' => 'fill: {{VALUE}}',
1508 ),
1509 'condition' => array(
1510 'premium_button_hover_effect' => 'style4',
1511 'slide_icon_type' => 'icon',
1512 ),
1513 )
1514 );
1515
1516 $this->add_control(
1517 'premium_button_background_hover',
1518 array(
1519 'label' => __( 'Background Color', 'premium-addons-for-elementor' ),
1520 'type' => Controls_Manager::COLOR,
1521 'global' => array(
1522 'default' => Global_Colors::COLOR_TEXT,
1523 ),
1524 'selectors' => array(
1525 '{{WRAPPER}} .premium-button-none:hover, {{WRAPPER}} .premium-button-style8:hover, {{WRAPPER}} .premium-button-style1:before, {{WRAPPER}} .premium-button-style2-shutouthor:before, {{WRAPPER}} .premium-button-style2-shutoutver:before, {{WRAPPER}} .premium-button-style2-shutinhor, {{WRAPPER}} .premium-button-style2-shutinver, {{WRAPPER}} .premium-button-style2-dshutinhor:before, {{WRAPPER}} .premium-button-style2-dshutinver:before, {{WRAPPER}} .premium-button-style2-scshutouthor:before, {{WRAPPER}} .premium-button-style2-scshutoutver:before, {{WRAPPER}} .premium-button-style3-after:hover, {{WRAPPER}} .premium-button-style3-before:hover, {{WRAPPER}} .premium-button-style4-icon-wrapper, {{WRAPPER}} .premium-button-style5-radialin, {{WRAPPER}} .premium-button-style5-radialout:before, {{WRAPPER}} .premium-button-style5-rectin, {{WRAPPER}} .premium-button-style5-rectout:before, {{WRAPPER}} .premium-button-style6-bg, {{WRAPPER}} .premium-button-style6:before' => 'background-color: {{VALUE}}',
1526 ),
1527 'condition' => array(
1528 'premium_button_hover_effect!' => 'style7',
1529
1530 ),
1531 )
1532 );
1533
1534 $this->add_control(
1535 'first_layer_hover',
1536 array(
1537 'label' => __( 'Layer #1 Color', 'premium-addons-for-elementor' ),
1538 'type' => Controls_Manager::COLOR,
1539 'global' => array(
1540 'default' => Global_Colors::COLOR_SECONDARY,
1541 ),
1542 'selectors' => array(
1543 '{{WRAPPER}} .premium-button-style7 .premium-button-text-icon-wrapper:before' => 'background-color: {{VALUE}}',
1544 ),
1545 'condition' => array(
1546 'premium_button_hover_effect' => 'style7',
1547
1548 ),
1549 )
1550 );
1551
1552 $this->add_control(
1553 'second_layer_hover',
1554 array(
1555 'label' => __( 'Layer #2 Color', 'premium-addons-for-elementor' ),
1556 'type' => Controls_Manager::COLOR,
1557 'global' => array(
1558 'default' => Global_Colors::COLOR_TEXT,
1559 ),
1560 'selectors' => array(
1561 '{{WRAPPER}} .premium-button-style7 .premium-button-text-icon-wrapper:after' => 'background-color: {{VALUE}}',
1562 ),
1563 'condition' => array(
1564 'premium_button_hover_effect' => 'style7',
1565 ),
1566 )
1567 );
1568
1569 $this->add_group_control(
1570 Group_Control_Border::get_type(),
1571 array(
1572 'name' => 'premium_button_border_hover',
1573 'selector' => '{{WRAPPER}} .premium-button:hover',
1574 )
1575 );
1576
1577 $this->add_control(
1578 'premium_button_border_radius_hover',
1579 array(
1580 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
1581 'type' => Controls_Manager::SLIDER,
1582 'size_units' => array( 'px', '%', 'em' ),
1583 'selectors' => array(
1584 '{{WRAPPER}} .premium-button:hover' => 'border-radius: {{SIZE}}{{UNIT}};',
1585 ),
1586 'condition' => array(
1587 'button_hover_adv_radius!' => 'yes',
1588 ),
1589 )
1590 );
1591
1592 $this->add_control(
1593 'button_hover_adv_radius',
1594 array(
1595 'label' => __( 'Advanced Border Radius', 'premium-addons-for-elementor' ),
1596 'type' => Controls_Manager::SWITCHER,
1597 'description' => __( 'Apply custom radius values. Get the radius value from ', 'premium-addons-for-elementor' ) . '<a href="https://9elements.github.io/fancy-border-radius/" target="_blank">here</a>' . __( '. See ', 'premium-addons-for-elementor' ) . '<a href="https://www.youtube.com/watch?v=S0BJazLHV-M" target="_blank">tutorial</a>',
1598 )
1599 );
1600
1601 $this->add_control(
1602 'button_hover_adv_radius_value',
1603 array(
1604 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
1605 'type' => Controls_Manager::TEXT,
1606 'dynamic' => array( 'active' => true ),
1607 'selectors' => array(
1608 '{{WRAPPER}} .premium-button:hover' => 'border-radius: {{VALUE}};',
1609 ),
1610 'condition' => array(
1611 'button_hover_adv_radius' => 'yes',
1612 ),
1613 'ai' => array(
1614 'active' => false,
1615 ),
1616 )
1617 );
1618
1619 $this->add_group_control(
1620 Group_Control_Text_Shadow::get_type(),
1621 array(
1622 'label' => __( 'Icon Shadow', 'premium-addons-for-elementor' ),
1623 'name' => 'premium_button_icon_shadow_hover',
1624 'selector' => '{{WRAPPER}} .premium-button:hover .premium-button-text-icon-wrapper i',
1625 'condition' => array(
1626 'premium_button_icon_switcher' => 'yes',
1627 'icon_type' => 'icon',
1628 'premium_button_hover_effect!' => 'style4',
1629 ),
1630 )
1631 );
1632
1633 $this->add_group_control(
1634 Group_Control_Text_Shadow::get_type(),
1635 array(
1636 'label' => __( 'Icon Shadow', 'premium-addons-for-elementor' ),
1637 'name' => 'premium_button_style4_icon_shadow_hover',
1638 'selector' => '{{WRAPPER}} .premium-button:hover .premium-button-style4-icon-wrapper',
1639 'condition' => array(
1640 'premium_button_hover_effect' => 'style4',
1641 'slide_icon_type' => 'icon',
1642 ),
1643 )
1644 );
1645
1646 $this->add_group_control(
1647 Group_Control_Text_Shadow::get_type(),
1648 array(
1649 'label' => __( 'Text Shadow', 'premium-addons-for-elementor' ),
1650 'name' => 'premium_button_text_shadow_hover',
1651 'selector' => '{{WRAPPER}} .premium-button:hover .premium-button-text-icon-wrapper span',
1652 'condition' => array(
1653 'premium_button_hover_effect!' => 'style4',
1654 ),
1655 )
1656 );
1657
1658 $this->add_group_control(
1659 Group_Control_Box_Shadow::get_type(),
1660 array(
1661 'label' => __( 'Button Shadow', 'premium-addons-for-elementor' ),
1662 'name' => 'premium_button_box_shadow_hover',
1663 'selector' => '{{WRAPPER}} .premium-button:hover',
1664 )
1665 );
1666
1667 $this->add_responsive_control(
1668 'premium_button_margin_hover',
1669 array(
1670 'label' => __( 'Margin', 'premium-addons-for-elementor' ),
1671 'type' => Controls_Manager::DIMENSIONS,
1672 'size_units' => array( 'px', 'em', '%', 'vw', 'custom' ),
1673 'selectors' => array(
1674 '{{WRAPPER}} .premium-button:hover' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1675 ),
1676 )
1677 );
1678
1679 $this->add_responsive_control(
1680 'premium_button_padding_hover',
1681 array(
1682 'label' => __( 'Padding', 'premium-addons-for-elementor' ),
1683 'type' => Controls_Manager::DIMENSIONS,
1684 'size_units' => array( 'px', 'em', '%', 'vw', 'custom' ),
1685 'selectors' => array(
1686 '{{WRAPPER}} .premium-button:hover' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1687 ),
1688 )
1689 );
1690
1691 $this->end_controls_tab();
1692
1693 $this->end_controls_tabs();
1694
1695 $this->end_controls_section();
1696 }
1697
1698 /**
1699 * Render Button output on the frontend.
1700 *
1701 * Written in PHP and used to generate the final HTML.
1702 *
1703 * @since 1.0.0
1704 * @access protected
1705 */
1706 protected function render() {
1707
1708 $settings = $this->get_settings_for_display();
1709
1710 $this->add_inline_editing_attributes( 'premium_button_text' );
1711
1712 $button_text = $settings['premium_button_text'];
1713
1714 if ( 'url' === $settings['premium_button_link_selection'] ) {
1715 $button_url = $settings['premium_button_link'];
1716 } else {
1717 $button_url = get_permalink( $settings['premium_button_existing_link'] );
1718 }
1719
1720 $button_size = 'premium-btn-' . $settings['premium_button_size'];
1721
1722 if ( 'yes' === $settings['premium_button_icon_switcher'] ) {
1723
1724 $icon_type = $settings['icon_type'];
1725
1726 if ( 'icon' === $icon_type || 'svg' === $icon_type ) {
1727
1728 $this->add_render_attribute( 'icon', 'class', 'premium-drawable-icon' );
1729
1730 if ( 'yes' === $settings['draw_svg'] ) {
1731
1732 $this->add_render_attribute(
1733 'button',
1734 'class',
1735 array(
1736 'elementor-invisible',
1737 'premium-drawer-hover',
1738 )
1739 );
1740
1741 $this->add_render_attribute(
1742 'icon',
1743 array(
1744 'class' => 'premium-svg-drawer',
1745 'data-svg-reverse' => $settings['lottie_reverse'],
1746 'data-svg-loop' => $settings['lottie_loop'],
1747 'data-svg-sync' => $settings['svg_sync'],
1748 'data-svg-hover' => $settings['svg_hover'],
1749 'data-svg-fill' => $settings['svg_color'],
1750 'data-svg-frames' => $settings['frames'],
1751 'data-svg-yoyo' => $settings['svg_yoyo'],
1752 'data-svg-point' => $settings['lottie_reverse'] ? $settings['end_point']['size'] : $settings['start_point']['size'],
1753 )
1754 );
1755
1756 } else {
1757 $this->add_render_attribute( 'icon', 'class', 'premium-svg-nodraw' );
1758 }
1759 } else {
1760 $this->add_render_attribute(
1761 'lottie',
1762 array(
1763 'class' => 'premium-lottie-animation',
1764 'data-lottie-url' => $settings['lottie_url'],
1765 'data-lottie-loop' => $settings['lottie_loop'],
1766 'data-lottie-reverse' => $settings['lottie_reverse'],
1767 'data-lottie-hover' => $settings['svg_hover'],
1768 )
1769 );
1770 }
1771 }
1772
1773 if ( 'none' === $settings['premium_button_hover_effect'] ) {
1774 $style_dir = 'premium-button-none';
1775 } elseif ( 'style1' === $settings['premium_button_hover_effect'] ) {
1776 $style_dir = 'premium-button-style1-' . $settings['premium_button_style1_dir'];
1777 } elseif ( 'style2' === $settings['premium_button_hover_effect'] ) {
1778 $style_dir = 'premium-button-style2-' . $settings['premium_button_style2_dir'];
1779 } elseif ( 'style3' === $settings['premium_button_hover_effect'] ) {
1780 $style_dir = 'premium-button-style3-' . $settings['premium_button_icon_position'];
1781 } elseif ( 'style4' === $settings['premium_button_hover_effect'] ) {
1782 $style_dir = 'premium-button-style4-' . $settings['premium_button_style4_dir'];
1783
1784 $slide_icon_type = $settings['slide_icon_type'];
1785
1786 if ( 'icon' !== $slide_icon_type ) {
1787
1788 $this->add_render_attribute(
1789 'slide_lottie',
1790 array(
1791 'class' => 'premium-lottie-animation',
1792 'data-lottie-url' => $settings['slide_lottie_url'],
1793 'data-lottie-loop' => $settings['slide_lottie_loop'],
1794 'data-lottie-reverse' => $settings['slide_lottie_reverse'],
1795 )
1796 );
1797
1798 }
1799 } elseif ( 'style5' === $settings['premium_button_hover_effect'] ) {
1800 $style_dir = 'premium-button-style5-' . $settings['premium_button_style5_dir'];
1801 } elseif ( 'style6' === $settings['premium_button_hover_effect'] ) {
1802 $style_dir = 'premium-button-style6';
1803 $mouse_detect = $settings['mouse_detect'];
1804 $this->add_render_attribute( 'style6', 'class', 'premium-button-style6-bg' );
1805 } elseif ( 'style7' === $settings['premium_button_hover_effect'] ) {
1806 $style_dir = 'premium-button-style7-' . $settings['premium_button_style4_dir'];
1807 } else {
1808 $style_dir = 'premium-button-' . $settings['underline_style'];
1809
1810 $this->add_render_attribute( 'button', 'data-text', $button_text );
1811 }
1812
1813 $this->add_render_attribute(
1814 'button',
1815 'class',
1816 array(
1817 'premium-button',
1818 'premium-button-' . $settings['premium_button_hover_effect'],
1819 $button_size,
1820 $style_dir,
1821 )
1822 );
1823
1824 if ( ! empty( $button_url ) ) {
1825
1826 if ( 'url' === $settings['premium_button_link_selection'] ) {
1827 $this->add_link_attributes( 'button', $button_url );
1828 } else {
1829 $this->add_render_attribute( 'button', 'href', $button_url );
1830 }
1831 }
1832
1833 if ( isset( $settings['premium_button_event_switcher'] ) ) {
1834 $button_event = $settings['premium_button_event_function'];
1835 if ( 'yes' === $settings['premium_button_event_switcher'] && ! empty( $button_event ) ) {
1836
1837 if ( Helper_Functions::check_capability( 'unfiltered_html' ) ) {
1838 $this->add_render_attribute( 'button', 'onclick', ( $button_event ) );
1839 }
1840 }
1841 }
1842
1843 ?>
1844
1845
1846 <a <?php $this->print_render_attribute_string( 'button' ); ?>>
1847 <div class="premium-button-text-icon-wrapper">
1848 <?php if ( 'yes' === $settings['premium_button_icon_switcher'] ) : ?>
1849
1850 <?php if ( 'style4' !== $settings['premium_button_hover_effect'] ) : ?>
1851 <?php if ( 'icon' === $icon_type ) : ?>
1852 <?php
1853
1854 echo Helper_Functions::get_svg_by_icon(
1855 $settings['premium_button_icon_selection_updated'],
1856 $this->get_render_attribute_string( 'icon' )
1857 );// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
1858
1859 ?>
1860 <?php elseif ( 'svg' === $icon_type ) : ?>
1861 <div <?php $this->print_render_attribute_string( 'icon' ); ?>>
1862 <?php echo Helper_Functions::sanitize_svg( $this->get_settings_for_display( 'custom_svg' ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- sanitize_svg passes through wp_kses with a strict SVG allowlist ?>
1863 </div>
1864 <?php else : ?>
1865 <div <?php $this->print_render_attribute_string( 'lottie' ); ?>></div>
1866 <?php endif; ?>
1867 <?php endif; ?>
1868 <?php endif; ?>
1869
1870 <?php if ( ! empty( $button_text ) ) : ?>
1871 <span <?php $this->print_render_attribute_string( 'premium_button_text' ); ?>>
1872 <?php echo wp_kses_post( $button_text ); ?>
1873 </span>
1874 <?php endif; ?>
1875 </div>
1876
1877 <?php if ( 'style4' === $settings['premium_button_hover_effect'] ) : ?>
1878 <div class="premium-button-style4-icon-wrapper <?php echo esc_attr( $settings['premium_button_style4_dir'] ); ?>">
1879 <?php if ( 'icon' === $slide_icon_type ) : ?>
1880 <?php
1881
1882 Icons_Manager::render_icon( $settings['premium_button_style4_icon_selection_updated'], array( 'aria-hidden' => 'true' ) );
1883 ?>
1884 <?php else : ?>
1885 <div <?php $this->print_render_attribute_string( 'slide_lottie' ); ?>></div>
1886 <?php endif; ?>
1887 </div>
1888 <?php endif; ?>
1889
1890 <?php if ( 'style6' === $settings['premium_button_hover_effect'] && 'yes' === $mouse_detect ) : ?>
1891 <span <?php $this->print_render_attribute_string( 'style6' ); ?>></span>
1892 <?php endif; ?>
1893
1894 <?php if ( 'style8' === $settings['premium_button_hover_effect'] ) : ?>
1895 <?php echo Helper_Functions::get_btn_svgs( $settings['underline_style'] ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
1896 <?php endif; ?>
1897
1898 </a>
1899
1900
1901 <?php
1902 }
1903 }
1904