PluginProbe ʕ •ᴥ•ʔ
Premium Addons for Elementor – Powerful Elementor Templates & Widgets / 4.11.83
Premium Addons for Elementor – Powerful Elementor Templates & Widgets v4.11.83
4.11.84 4.11.83 4.11.82 4.11.80 4.11.81 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 3 weeks ago premium-banner.php 2 weeks ago premium-blog.php 2 weeks ago premium-button.php 2 weeks ago premium-carousel.php 2 weeks ago premium-contactform.php 2 weeks ago premium-countdown.php 2 weeks ago premium-counter.php 2 weeks ago premium-dual-header.php 2 weeks ago premium-fancytext.php 2 weeks ago premium-grid.php 2 weeks ago premium-icon-list.php 2 weeks ago premium-image-button.php 2 weeks ago premium-image-scroll.php 2 weeks ago premium-image-separator.php 2 weeks ago premium-lottie.php 2 weeks ago premium-maps.php 3 days ago premium-media-wheel.php 2 weeks ago premium-mobile-menu.php 2 weeks ago premium-modalbox.php 3 days ago premium-nav-menu.php 2 weeks ago premium-notifications.php 2 weeks ago premium-person.php 2 weeks ago premium-pinterest-feed.php 2 weeks ago premium-post-ticker.php 2 weeks ago premium-pricing-table.php 3 days ago premium-progressbar.php 2 weeks ago premium-search-form.php 3 days ago premium-svg-drawer.php 2 weeks ago premium-tcloud.php 2 weeks ago premium-testimonials.php 2 weeks ago premium-textual-showcase.php 2 weeks ago premium-tiktok-feed.php 2 weeks ago premium-title.php 3 days ago premium-videobox.php 2 weeks ago premium-vscroll.php 2 weeks ago premium-weather.php 2 weeks ago premium-world-clock.php 2 weeks ago
premium-button.php
1900 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_hover_effect' => 'style3',
982 ),
983 'range' => array(
984 'px' => array(
985 'min' => -50,
986 'max' => 50,
987 ),
988 ),
989 'selectors' => array(
990 '{{WRAPPER}} .premium-button-style3:hover i, {{WRAPPER}} .premium-button-style3:hover svg' => '-webkit-transform: translateX({{SIZE}}{{UNIT}}); transform: translateX({{SIZE}}{{UNIT}})',
991 ),
992 )
993 );
994
995 $this->add_control(
996 'slide_lottie_loop',
997 array(
998 'label' => __( 'Loop', 'premium-addons-for-elementor' ),
999 'type' => Controls_Manager::SWITCHER,
1000 'return_value' => 'true',
1001 'default' => 'true',
1002 'condition' => array(
1003 'slide_icon_type' => 'animation',
1004 'premium_button_hover_effect' => 'style4',
1005 ),
1006 )
1007 );
1008
1009 $this->add_control(
1010 'slide_lottie_reverse',
1011 array(
1012 'label' => __( 'Reverse', 'premium-addons-for-elementor' ),
1013 'type' => Controls_Manager::SWITCHER,
1014 'return_value' => 'true',
1015 'condition' => array(
1016 'slide_icon_type' => 'animation',
1017 'premium_button_hover_effect' => 'style4',
1018 ),
1019 )
1020 );
1021
1022 $this->add_control(
1023 'premium_button_size',
1024 array(
1025 'label' => __( 'Size', 'premium-addons-for-elementor' ),
1026 'type' => Controls_Manager::SELECT,
1027 'default' => 'lg',
1028 'options' => array(
1029 'sm' => __( 'Small', 'premium-addons-for-elementor' ),
1030 'md' => __( 'Medium', 'premium-addons-for-elementor' ),
1031 'lg' => __( 'Large', 'premium-addons-for-elementor' ),
1032 'block' => __( 'Block', 'premium-addons-for-elementor' ),
1033 ),
1034 'label_block' => true,
1035 'separator' => 'before',
1036 )
1037 );
1038
1039 $this->add_responsive_control(
1040 'premium_button_align',
1041 array(
1042 'label' => __( 'Alignment', 'premium-addons-for-elementor' ),
1043 'type' => Controls_Manager::CHOOSE,
1044 'options' => array(
1045 'left' => array(
1046 'title' => __( 'Left', 'premium-addons-for-elementor' ),
1047 'icon' => 'eicon-text-align-left',
1048 ),
1049 'center' => array(
1050 'title' => __( 'Center', 'premium-addons-for-elementor' ),
1051 'icon' => 'eicon-text-align-center',
1052 ),
1053 'right' => array(
1054 'title' => __( 'Right', 'premium-addons-for-elementor' ),
1055 'icon' => 'eicon-text-align-right',
1056 ),
1057 ),
1058 'selectors' => array(
1059 '{{WRAPPER}}' => 'text-align: {{VALUE}}',
1060 ),
1061 'toggle' => false,
1062 'default' => 'center',
1063 'condition' => array(
1064 'premium_button_size!' => 'block',
1065 ),
1066 )
1067 );
1068
1069 // Allow admins only to add JS.
1070 if ( current_user_can( 'manage_options' ) ) {
1071 $this->add_control(
1072 'premium_button_event_switcher',
1073 array(
1074 'label' => __( 'onclick Event', 'premium-addons-for-elementor' ),
1075 'type' => Controls_Manager::SWITCHER,
1076 )
1077 );
1078
1079 $this->add_control(
1080 'premium_button_event_function',
1081 array(
1082 'label' => __( 'Example: myFunction();', 'premium-addons-for-elementor' ),
1083 'type' => Controls_Manager::CODE,
1084 'dynamic' => array( 'active' => true ),
1085 'condition' => array(
1086 'premium_button_event_switcher' => 'yes',
1087 ),
1088 )
1089 );
1090
1091 }
1092
1093 $this->end_controls_section();
1094
1095 $this->start_controls_section(
1096 'section_pa_docs',
1097 array(
1098 'label' => __( 'Help & Docs', 'premium-addons-for-elementor' ),
1099 )
1100 );
1101
1102 $docs = array(
1103 'https://premiumaddons.com/docs/button-widget-tutorial' => __( 'Getting started »', 'premium-addons-for-elementor' ),
1104 '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' ),
1105 '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' ),
1106 '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' ),
1107 );
1108
1109 $doc_index = 1;
1110 foreach ( $docs as $url => $title ) {
1111
1112 $doc_url = Helper_Functions::get_campaign_link( $url, 'button-widget', 'wp-editor', 'get-support' );
1113
1114 $this->add_control(
1115 'doc_' . $doc_index,
1116 array(
1117 'type' => Controls_Manager::RAW_HTML,
1118 'raw' => sprintf( '<a href="%s" target="_blank">%s</a>', $doc_url, $title ),
1119 'content_classes' => 'editor-pa-doc',
1120 )
1121 );
1122
1123 ++$doc_index;
1124
1125 }
1126
1127 Helper_Functions::register_element_feedback_controls( $this );
1128
1129 $this->end_controls_section();
1130
1131 Helper_Functions::register_papro_promotion_controls( $this, 'button' );
1132
1133 $this->start_controls_section(
1134 'premium_button_style_section',
1135 array(
1136 'label' => __( 'Button', 'premium-addons-for-elementor' ),
1137 'tab' => Controls_Manager::TAB_STYLE,
1138 )
1139 );
1140
1141 $this->add_responsive_control(
1142 'button_width',
1143 array(
1144 'label' => __( 'Width', 'premium-addons-for-elementor' ),
1145 'type' => Controls_Manager::SLIDER,
1146 'size_units' => array( 'px', '%', 'vw', 'custom' ),
1147 'range' => array(
1148 'px' => array(
1149 'min' => 1,
1150 'max' => 500,
1151 ),
1152 ),
1153 'selectors' => array(
1154 '{{WRAPPER}} .premium-button' => 'width: {{SIZE}}{{UNIT}};',
1155 ),
1156 'condition' => array(
1157 'premium_button_size!' => 'block',
1158 ),
1159 )
1160 );
1161
1162 if ( $draw_icon ) {
1163 $this->add_control(
1164 'svg_color',
1165 array(
1166 'label' => __( 'After Draw Fill Color', 'premium-addons-for-elementor' ),
1167 'type' => Controls_Manager::COLOR,
1168 'global' => false,
1169 'separator' => 'after',
1170 'condition' => array(
1171 'premium_button_icon_switcher' => 'yes',
1172 'icon_type' => array( 'icon', 'svg' ),
1173 'premium_button_hover_effect!' => 'style4',
1174 'draw_svg' => 'yes',
1175 ),
1176 )
1177 );
1178 }
1179
1180 $this->add_group_control(
1181 Group_Control_Typography::get_type(),
1182 array(
1183 'name' => 'premium_button_typo',
1184 'global' => array(
1185 'default' => Global_Typography::TYPOGRAPHY_PRIMARY,
1186 ),
1187 'selector' => '{{WRAPPER}} .premium-button .premium-button-text-icon-wrapper span',
1188 )
1189 );
1190
1191 $this->start_controls_tabs( 'premium_button_style_tabs' );
1192
1193 $this->start_controls_tab(
1194 'premium_button_style_normal',
1195 array(
1196 'label' => __( 'Normal', 'premium-addons-for-elementor' ),
1197 )
1198 );
1199
1200 $this->add_control(
1201 'premium_button_text_color_normal',
1202 array(
1203 'label' => __( 'Text Color', 'premium-addons-for-elementor' ),
1204 'type' => Controls_Manager::COLOR,
1205 'global' => array(
1206 'default' => Global_Colors::COLOR_SECONDARY,
1207 ),
1208 'selectors' => array(
1209 '{{WRAPPER}} .premium-button .premium-button-text-icon-wrapper span' => 'color: {{VALUE}};',
1210 ),
1211 )
1212 );
1213
1214 $this->add_control(
1215 'premium_button_icon_color_normal',
1216 array(
1217 'label' => __( 'Icon Color', 'premium-addons-for-elementor' ),
1218 'type' => Controls_Manager::COLOR,
1219 'global' => array(
1220 'default' => Global_Colors::COLOR_SECONDARY,
1221 ),
1222 'selectors' => array(
1223 '{{WRAPPER}} .premium-button-text-icon-wrapper i' => 'color: {{VALUE}}',
1224 '{{WRAPPER}} .premium-drawable-icon *, {{WRAPPER}} .premium-button-text-icon-wrapper svg:not([class*="premium-"])' => 'fill: {{VALUE}};',
1225 ),
1226 'condition' => array(
1227 'premium_button_icon_switcher' => 'yes',
1228 'icon_type' => array( 'icon', 'svg' ),
1229 'premium_button_hover_effect!' => array( 'style3', 'style4' ),
1230 ),
1231 )
1232 );
1233
1234 if ( $draw_icon ) {
1235 $this->add_control(
1236 'stroke_color',
1237 array(
1238 'label' => __( 'Stroke Color', 'premium-addons-for-elementor' ),
1239 'type' => Controls_Manager::COLOR,
1240 'global' => array(
1241 'default' => Global_Colors::COLOR_ACCENT,
1242 ),
1243 'condition' => array(
1244 'premium_button_icon_switcher' => 'yes',
1245 'icon_type' => array( 'icon', 'svg' ),
1246 'premium_button_hover_effect!' => array( 'style3', 'style4' ),
1247 ),
1248 'selectors' => array(
1249 // Drawable SVG icons
1250 '{{WRAPPER}} .premium-drawable-icon *' => 'stroke: {{VALUE}};',
1251 // Normal SVG icons (exclude Lottie SVGs)
1252 '{{WRAPPER}} svg:not(.premium-lottie-animation):not(.premium-lottie-animation svg)' => 'stroke: {{VALUE}};',
1253 ),
1254 )
1255 );
1256 }
1257
1258 $this->add_control(
1259 'premium_button_background_normal',
1260 array(
1261 'label' => __( 'Background Color', 'premium-addons-for-elementor' ),
1262 'type' => Controls_Manager::COLOR,
1263 'global' => array(
1264 'default' => Global_Colors::COLOR_PRIMARY,
1265 ),
1266 'selectors' => array(
1267 '{{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}};',
1268 ),
1269 )
1270 );
1271
1272 $this->add_control(
1273 'btn_lq_effect',
1274 array(
1275 'label' => __( 'Liquid Glass Effect', 'premium-addons-for-elementor' ),
1276 'type' => Controls_Manager::SELECT,
1277 'description' => sprintf(
1278 /* translators: 1: `<a>` opening tag, 2: `</a>` closing tag. */
1279 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' ),
1280 '<a href="https://premiumaddons.com/liquid-glass/" target="_blank">',
1281 '</a>'
1282 ),
1283 'options' => array(
1284 'none' => __( 'None', 'premium-addons-for-elementor' ),
1285 'glass1' => __( 'Preset 01', 'premium-addons-for-elementor' ),
1286 'glass2' => __( 'Preset 02', 'premium-addons-for-elementor' ),
1287 'glass3' => apply_filters( 'pa_pro_label', __( 'Preset 03 (Pro)', 'premium-addons-for-elementor' ) ),
1288 'glass4' => apply_filters( 'pa_pro_label', __( 'Preset 04 (Pro)', 'premium-addons-for-elementor' ) ),
1289 'glass5' => apply_filters( 'pa_pro_label', __( 'Preset 05 (Pro)', 'premium-addons-for-elementor' ) ),
1290 'glass6' => apply_filters( 'pa_pro_label', __( 'Preset 06 (Pro)', 'premium-addons-for-elementor' ) ),
1291 ),
1292 'prefix_class' => 'premium-lq__',
1293 'default' => 'none',
1294 'render_type' => 'template',
1295 'label_block' => true,
1296 'condition' => array(
1297 'premium_button_hover_effect!' => array( 'style2', 'style5' ),
1298 ),
1299 )
1300 );
1301
1302 $this->add_group_control(
1303 Group_Control_Border::get_type(),
1304 array(
1305 'name' => 'premium_button_border_normal',
1306 'selector' => '{{WRAPPER}} .premium-button',
1307 )
1308 );
1309
1310 $this->add_control(
1311 'premium_button_border_radius_normal',
1312 array(
1313 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
1314 'type' => Controls_Manager::SLIDER,
1315 'size_units' => array( 'px', '%', 'em' ),
1316 'selectors' => array(
1317 '{{WRAPPER}} .premium-button' => 'border-radius: {{SIZE}}{{UNIT}};',
1318 ),
1319 'condition' => array(
1320 'button_adv_radius!' => 'yes',
1321 ),
1322 )
1323 );
1324
1325 $this->add_control(
1326 'button_adv_radius',
1327 array(
1328 'label' => __( 'Advanced Border Radius', 'premium-addons-for-elementor' ),
1329 'type' => Controls_Manager::SWITCHER,
1330 '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>',
1331 )
1332 );
1333
1334 $this->add_control(
1335 'button_adv_radius_value',
1336 array(
1337 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
1338 'type' => Controls_Manager::TEXT,
1339 'dynamic' => array( 'active' => true ),
1340 'selectors' => array(
1341 '{{WRAPPER}} .premium-button' => 'border-radius: {{VALUE}};',
1342 ),
1343 'condition' => array(
1344 'button_adv_radius' => 'yes',
1345 ),
1346 'ai' => array(
1347 'active' => false,
1348 ),
1349 )
1350 );
1351
1352 $this->add_group_control(
1353 Group_Control_Text_Shadow::get_type(),
1354 array(
1355 'label' => __( 'Icon Shadow', 'premium-addons-for-elementor' ),
1356 'name' => 'premium_button_icon_shadow_normal',
1357 'selector' => '{{WRAPPER}} .premium-button-text-icon-wrapper i',
1358 'condition' => array(
1359 'premium_button_icon_switcher' => 'yes',
1360 'icon_type' => 'icon',
1361 'premium_button_hover_effect!' => array( 'style3', 'style4' ),
1362 ),
1363 )
1364 );
1365
1366 $this->add_group_control(
1367 Group_Control_Text_Shadow::get_type(),
1368 array(
1369 'label' => __( 'Text Shadow', 'premium-addons-for-elementor' ),
1370 'name' => 'premium_button_text_shadow_normal',
1371 'selector' => '{{WRAPPER}} .premium-button-text-icon-wrapper span',
1372 )
1373 );
1374
1375 $this->add_group_control(
1376 Group_Control_Box_Shadow::get_type(),
1377 array(
1378 'label' => __( 'Button Shadow', 'premium-addons-for-elementor' ),
1379 'name' => 'premium_button_box_shadow_normal',
1380 'selector' => '{{WRAPPER}} .premium-button',
1381 )
1382 );
1383
1384 $this->add_responsive_control(
1385 'premium_button_margin_normal',
1386 array(
1387 'label' => __( 'Margin', 'premium-addons-for-elementor' ),
1388 'type' => Controls_Manager::DIMENSIONS,
1389 'size_units' => array( 'px', 'em', '%', 'vw', 'custom' ),
1390 'selectors' => array(
1391 '{{WRAPPER}} .premium-button' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1392 ),
1393 )
1394 );
1395
1396 $this->add_responsive_control(
1397 'premium_button_padding_normal',
1398 array(
1399 'label' => __( 'Padding', 'premium-addons-for-elementor' ),
1400 'type' => Controls_Manager::DIMENSIONS,
1401 'size_units' => array( 'px', 'em', '%', 'vw', 'custom' ),
1402 'selectors' => array(
1403 '{{WRAPPER}} .premium-button, {{WRAPPER}} .premium-button-line6::after' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1404 ),
1405 )
1406 );
1407
1408 $this->end_controls_tab();
1409
1410 $this->start_controls_tab(
1411 'premium_button_style_hover',
1412 array(
1413 'label' => __( 'Hover', 'premium-addons-for-elementor' ),
1414 )
1415 );
1416
1417 $this->add_control(
1418 'premium_button_text_color_hover',
1419 array(
1420 'label' => __( 'Text Color', 'premium-addons-for-elementor' ),
1421 'type' => Controls_Manager::COLOR,
1422 'global' => array(
1423 'default' => Global_Colors::COLOR_PRIMARY,
1424 ),
1425 'selectors' => array(
1426 '{{WRAPPER}} .premium-button:hover .premium-button-text-icon-wrapper span, {{WRAPPER}} .premium-button-line6::after' => 'color: {{VALUE}};',
1427 ),
1428 'condition' => array(
1429 'premium_button_hover_effect!' => 'style4',
1430 ),
1431 )
1432 );
1433
1434 $this->add_control(
1435 'premium_button_icon_color_hover',
1436 array(
1437 'label' => __( 'Icon Color', 'premium-addons-for-elementor' ),
1438 'type' => Controls_Manager::COLOR,
1439 'global' => array(
1440 'default' => Global_Colors::COLOR_PRIMARY,
1441 ),
1442 'selectors' => array(
1443 '{{WRAPPER}} .premium-button:hover .premium-button-text-icon-wrapper i' => 'color: {{VALUE}}',
1444 '{{WRAPPER}} .premium-button:hover .premium-drawable-icon *, {{WRAPPER}} .premium-button:hover svg:not([class*="premium-"])' => 'fill: {{VALUE}};',
1445 ),
1446 'condition' => array(
1447 'premium_button_icon_switcher' => 'yes',
1448 'icon_type' => array( 'icon', 'svg' ),
1449 'premium_button_hover_effect!' => 'style4',
1450 ),
1451 )
1452 );
1453
1454 $this->add_control(
1455 'underline_color',
1456 array(
1457 'label' => __( 'Line Color', 'premium-addons-for-elementor' ),
1458 'type' => Controls_Manager::COLOR,
1459 'global' => array(
1460 'default' => Global_Colors::COLOR_SECONDARY,
1461 ),
1462 'selectors' => array(
1463 '{{WRAPPER}} .premium-btn-svg' => 'stroke: {{VALUE}};',
1464 '{{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}};',
1465 ),
1466 'condition' => array(
1467 'premium_button_hover_effect' => 'style8',
1468 ),
1469 )
1470 );
1471
1472 if ( $draw_icon ) {
1473 $this->add_control(
1474 'stroke_color_hover',
1475 array(
1476 'label' => __( 'Stroke Color', 'premium-addons-for-elementor' ),
1477 'type' => Controls_Manager::COLOR,
1478 'global' => array(
1479 'default' => Global_Colors::COLOR_ACCENT,
1480 ),
1481 'condition' => array(
1482 'premium_button_icon_switcher' => 'yes',
1483 'icon_type' => array( 'icon', 'svg' ),
1484 'premium_button_hover_effect!' => 'style4',
1485 ),
1486 'selectors' => array(
1487 // Drawable SVG icons
1488 '{{WRAPPER}} .premium-button:hover .premium-drawable-icon *' => 'stroke: {{VALUE}};',
1489 // Normal SVG icons (exclude Lottie SVGs)
1490 '{{WRAPPER}} .premium-button:hover svg:not(.premium-lottie-animation):not(.premium-lottie-animation svg)' => 'stroke: {{VALUE}};',
1491 ),
1492 )
1493 );
1494 }
1495
1496 $this->add_control(
1497 'premium_button_style4_icon_color',
1498 array(
1499 'label' => __( 'Icon Color', 'premium-addons-for-elementor' ),
1500 'type' => Controls_Manager::COLOR,
1501 'global' => array(
1502 'default' => Global_Colors::COLOR_PRIMARY,
1503 ),
1504 'selectors' => array(
1505 '{{WRAPPER}} .premium-button-style4-icon-wrapper' => 'color: {{VALUE}}',
1506 '{{WRAPPER}} .premium-button-style4-icon-wrapper svg' => 'fill: {{VALUE}}',
1507 ),
1508 'condition' => array(
1509 'premium_button_hover_effect' => 'style4',
1510 'slide_icon_type' => 'icon',
1511 ),
1512 )
1513 );
1514
1515 $this->add_control(
1516 'premium_button_background_hover',
1517 array(
1518 'label' => __( 'Background Color', 'premium-addons-for-elementor' ),
1519 'type' => Controls_Manager::COLOR,
1520 'global' => array(
1521 'default' => Global_Colors::COLOR_TEXT,
1522 ),
1523 'selectors' => array(
1524 '{{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}}',
1525 ),
1526 'condition' => array(
1527 'premium_button_hover_effect!' => 'style7',
1528
1529 ),
1530 )
1531 );
1532
1533 $this->add_control(
1534 'first_layer_hover',
1535 array(
1536 'label' => __( 'Layer #1 Color', 'premium-addons-for-elementor' ),
1537 'type' => Controls_Manager::COLOR,
1538 'global' => array(
1539 'default' => Global_Colors::COLOR_SECONDARY,
1540 ),
1541 'selectors' => array(
1542 '{{WRAPPER}} .premium-button-style7 .premium-button-text-icon-wrapper:before' => 'background-color: {{VALUE}}',
1543 ),
1544 'condition' => array(
1545 'premium_button_hover_effect' => 'style7',
1546
1547 ),
1548 )
1549 );
1550
1551 $this->add_control(
1552 'second_layer_hover',
1553 array(
1554 'label' => __( 'Layer #2 Color', 'premium-addons-for-elementor' ),
1555 'type' => Controls_Manager::COLOR,
1556 'global' => array(
1557 'default' => Global_Colors::COLOR_TEXT,
1558 ),
1559 'selectors' => array(
1560 '{{WRAPPER}} .premium-button-style7 .premium-button-text-icon-wrapper:after' => 'background-color: {{VALUE}}',
1561 ),
1562 'condition' => array(
1563 'premium_button_hover_effect' => 'style7',
1564 ),
1565 )
1566 );
1567
1568 $this->add_group_control(
1569 Group_Control_Border::get_type(),
1570 array(
1571 'name' => 'premium_button_border_hover',
1572 'selector' => '{{WRAPPER}} .premium-button:hover',
1573 )
1574 );
1575
1576 $this->add_control(
1577 'premium_button_border_radius_hover',
1578 array(
1579 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
1580 'type' => Controls_Manager::SLIDER,
1581 'size_units' => array( 'px', '%', 'em' ),
1582 'selectors' => array(
1583 '{{WRAPPER}} .premium-button:hover' => 'border-radius: {{SIZE}}{{UNIT}};',
1584 ),
1585 'condition' => array(
1586 'button_hover_adv_radius!' => 'yes',
1587 ),
1588 )
1589 );
1590
1591 $this->add_control(
1592 'button_hover_adv_radius',
1593 array(
1594 'label' => __( 'Advanced Border Radius', 'premium-addons-for-elementor' ),
1595 'type' => Controls_Manager::SWITCHER,
1596 '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>',
1597 )
1598 );
1599
1600 $this->add_control(
1601 'button_hover_adv_radius_value',
1602 array(
1603 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
1604 'type' => Controls_Manager::TEXT,
1605 'dynamic' => array( 'active' => true ),
1606 'selectors' => array(
1607 '{{WRAPPER}} .premium-button:hover' => 'border-radius: {{VALUE}};',
1608 ),
1609 'condition' => array(
1610 'button_hover_adv_radius' => 'yes',
1611 ),
1612 'ai' => array(
1613 'active' => false,
1614 ),
1615 )
1616 );
1617
1618 $this->add_group_control(
1619 Group_Control_Text_Shadow::get_type(),
1620 array(
1621 'label' => __( 'Icon Shadow', 'premium-addons-for-elementor' ),
1622 'name' => 'premium_button_icon_shadow_hover',
1623 'selector' => '{{WRAPPER}} .premium-button:hover .premium-button-text-icon-wrapper i',
1624 'condition' => array(
1625 'premium_button_icon_switcher' => 'yes',
1626 'icon_type' => 'icon',
1627 'premium_button_hover_effect!' => 'style4',
1628 ),
1629 )
1630 );
1631
1632 $this->add_group_control(
1633 Group_Control_Text_Shadow::get_type(),
1634 array(
1635 'label' => __( 'Icon Shadow', 'premium-addons-for-elementor' ),
1636 'name' => 'premium_button_style4_icon_shadow_hover',
1637 'selector' => '{{WRAPPER}} .premium-button:hover .premium-button-style4-icon-wrapper',
1638 'condition' => array(
1639 'premium_button_hover_effect' => 'style4',
1640 'slide_icon_type' => 'icon',
1641 ),
1642 )
1643 );
1644
1645 $this->add_group_control(
1646 Group_Control_Text_Shadow::get_type(),
1647 array(
1648 'label' => __( 'Text Shadow', 'premium-addons-for-elementor' ),
1649 'name' => 'premium_button_text_shadow_hover',
1650 'selector' => '{{WRAPPER}} .premium-button:hover .premium-button-text-icon-wrapper span',
1651 'condition' => array(
1652 'premium_button_hover_effect!' => 'style4',
1653 ),
1654 )
1655 );
1656
1657 $this->add_group_control(
1658 Group_Control_Box_Shadow::get_type(),
1659 array(
1660 'label' => __( 'Button Shadow', 'premium-addons-for-elementor' ),
1661 'name' => 'premium_button_box_shadow_hover',
1662 'selector' => '{{WRAPPER}} .premium-button:hover',
1663 )
1664 );
1665
1666 $this->add_responsive_control(
1667 'premium_button_margin_hover',
1668 array(
1669 'label' => __( 'Margin', 'premium-addons-for-elementor' ),
1670 'type' => Controls_Manager::DIMENSIONS,
1671 'size_units' => array( 'px', 'em', '%', 'vw', 'custom' ),
1672 'selectors' => array(
1673 '{{WRAPPER}} .premium-button:hover' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1674 ),
1675 )
1676 );
1677
1678 $this->add_responsive_control(
1679 'premium_button_padding_hover',
1680 array(
1681 'label' => __( 'Padding', 'premium-addons-for-elementor' ),
1682 'type' => Controls_Manager::DIMENSIONS,
1683 'size_units' => array( 'px', 'em', '%', 'vw', 'custom' ),
1684 'selectors' => array(
1685 '{{WRAPPER}} .premium-button:hover' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1686 ),
1687 )
1688 );
1689
1690 $this->end_controls_tab();
1691
1692 $this->end_controls_tabs();
1693
1694 $this->end_controls_section();
1695 }
1696
1697 /**
1698 * Render Button output on the frontend.
1699 *
1700 * Written in PHP and used to generate the final HTML.
1701 *
1702 * @since 1.0.0
1703 * @access protected
1704 */
1705 protected function render() {
1706
1707 $settings = $this->get_settings_for_display();
1708
1709 $this->add_inline_editing_attributes( 'premium_button_text' );
1710
1711 $button_text = $settings['premium_button_text'];
1712
1713 if ( 'url' === $settings['premium_button_link_selection'] ) {
1714 $button_url = $settings['premium_button_link'];
1715 } else {
1716 $button_url = get_permalink( $settings['premium_button_existing_link'] );
1717 }
1718
1719 $button_size = 'premium-btn-' . $settings['premium_button_size'];
1720
1721 if ( 'yes' === $settings['premium_button_icon_switcher'] ) {
1722
1723 $icon_type = $settings['icon_type'];
1724
1725 if ( 'icon' === $icon_type || 'svg' === $icon_type ) {
1726
1727 $this->add_render_attribute( 'icon', 'class', 'premium-drawable-icon' );
1728
1729 if ( 'yes' === $settings['draw_svg'] ) {
1730
1731 $this->add_render_attribute(
1732 'button',
1733 'class',
1734 array(
1735 'elementor-invisible',
1736 'premium-drawer-hover',
1737 )
1738 );
1739
1740 $this->add_render_attribute(
1741 'icon',
1742 array(
1743 'class' => 'premium-svg-drawer',
1744 'data-svg-reverse' => $settings['lottie_reverse'],
1745 'data-svg-loop' => $settings['lottie_loop'],
1746 'data-svg-sync' => $settings['svg_sync'],
1747 'data-svg-hover' => $settings['svg_hover'],
1748 'data-svg-fill' => $settings['svg_color'],
1749 'data-svg-frames' => $settings['frames'],
1750 'data-svg-yoyo' => $settings['svg_yoyo'],
1751 'data-svg-point' => $settings['lottie_reverse'] ? $settings['end_point']['size'] : $settings['start_point']['size'],
1752 )
1753 );
1754
1755 } else {
1756 $this->add_render_attribute( 'icon', 'class', 'premium-svg-nodraw' );
1757 }
1758 } else {
1759 $this->add_render_attribute(
1760 'lottie',
1761 array(
1762 'class' => 'premium-lottie-animation',
1763 'data-lottie-url' => $settings['lottie_url'],
1764 'data-lottie-loop' => $settings['lottie_loop'],
1765 'data-lottie-reverse' => $settings['lottie_reverse'],
1766 'data-lottie-hover' => $settings['svg_hover'],
1767 )
1768 );
1769 }
1770 }
1771
1772 if ( 'none' === $settings['premium_button_hover_effect'] ) {
1773 $style_dir = 'premium-button-none';
1774 } elseif ( 'style1' === $settings['premium_button_hover_effect'] ) {
1775 $style_dir = 'premium-button-style1-' . $settings['premium_button_style1_dir'];
1776 } elseif ( 'style2' === $settings['premium_button_hover_effect'] ) {
1777 $style_dir = 'premium-button-style2-' . $settings['premium_button_style2_dir'];
1778 } elseif ( 'style3' === $settings['premium_button_hover_effect'] ) {
1779 $style_dir = 'premium-button-style3-' . $settings['premium_button_icon_position'];
1780 } elseif ( 'style4' === $settings['premium_button_hover_effect'] ) {
1781 $style_dir = 'premium-button-style4-' . $settings['premium_button_style4_dir'];
1782
1783 $slide_icon_type = $settings['slide_icon_type'];
1784
1785 if ( 'icon' !== $slide_icon_type ) {
1786
1787 $this->add_render_attribute(
1788 'slide_lottie',
1789 array(
1790 'class' => 'premium-lottie-animation',
1791 'data-lottie-url' => $settings['slide_lottie_url'],
1792 'data-lottie-loop' => $settings['slide_lottie_loop'],
1793 'data-lottie-reverse' => $settings['slide_lottie_reverse'],
1794 )
1795 );
1796
1797 }
1798 } elseif ( 'style5' === $settings['premium_button_hover_effect'] ) {
1799 $style_dir = 'premium-button-style5-' . $settings['premium_button_style5_dir'];
1800 } elseif ( 'style6' === $settings['premium_button_hover_effect'] ) {
1801 $style_dir = 'premium-button-style6';
1802 $mouse_detect = $settings['mouse_detect'];
1803 $this->add_render_attribute( 'style6', 'class', 'premium-button-style6-bg' );
1804 } elseif ( 'style7' === $settings['premium_button_hover_effect'] ) {
1805 $style_dir = 'premium-button-style7-' . $settings['premium_button_style4_dir'];
1806 } else {
1807 $style_dir = 'premium-button-' . $settings['underline_style'];
1808
1809 $this->add_render_attribute( 'button', 'data-text', $button_text );
1810 }
1811
1812 $this->add_render_attribute(
1813 'button',
1814 'class',
1815 array(
1816 'premium-button',
1817 'premium-button-' . $settings['premium_button_hover_effect'],
1818 $button_size,
1819 $style_dir,
1820 )
1821 );
1822
1823 if ( ! empty( $button_url ) ) {
1824
1825 if ( 'url' === $settings['premium_button_link_selection'] ) {
1826 $this->add_link_attributes( 'button', $button_url );
1827 } else {
1828 $this->add_render_attribute( 'button', 'href', $button_url );
1829 }
1830 }
1831
1832 if ( isset( $settings['premium_button_event_switcher'] ) ) {
1833 $button_event = $settings['premium_button_event_function'];
1834 if ( 'yes' === $settings['premium_button_event_switcher'] && ! empty( $button_event ) ) {
1835
1836 if ( Helper_Functions::check_capability( 'unfiltered_html' ) ) {
1837 $this->add_render_attribute( 'button', 'onclick', ( $button_event ) );
1838 }
1839 }
1840 }
1841
1842 ?>
1843
1844
1845 <a <?php $this->print_render_attribute_string( 'button' ); ?>>
1846 <div class="premium-button-text-icon-wrapper">
1847 <?php if ( 'yes' === $settings['premium_button_icon_switcher'] ) : ?>
1848
1849 <?php if ( 'style4' !== $settings['premium_button_hover_effect'] ) : ?>
1850 <?php if ( 'icon' === $icon_type ) : ?>
1851 <?php
1852
1853 echo Helper_Functions::get_svg_by_icon( $settings['premium_button_icon_selection_updated'], $this->get_render_attribute_string( 'icon' ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- get_svg_by_icon() returns sanitized inline SVG/icon markup.
1854
1855 ?>
1856 <?php elseif ( 'svg' === $icon_type ) : ?>
1857 <div <?php $this->print_render_attribute_string( 'icon' ); ?>>
1858 <?php echo Helper_Functions::sanitize_svg( $this->get_settings_for_display( 'custom_svg' ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- sanitize_svg() returns wp_kses-sanitized SVG markup. ?>
1859 </div>
1860 <?php else : ?>
1861 <div <?php $this->print_render_attribute_string( 'lottie' ); ?>></div>
1862 <?php endif; ?>
1863 <?php endif; ?>
1864 <?php endif; ?>
1865
1866 <?php if ( ! empty( $button_text ) ) : ?>
1867 <span <?php $this->print_render_attribute_string( 'premium_button_text' ); ?>>
1868 <?php echo wp_kses_post( $button_text ); ?>
1869 </span>
1870 <?php endif; ?>
1871 </div>
1872
1873 <?php if ( 'style4' === $settings['premium_button_hover_effect'] ) : ?>
1874 <div class="premium-button-style4-icon-wrapper <?php echo esc_attr( $settings['premium_button_style4_dir'] ); ?>">
1875 <?php if ( 'icon' === $slide_icon_type ) : ?>
1876 <?php
1877
1878 Icons_Manager::render_icon( $settings['premium_button_style4_icon_selection_updated'], array( 'aria-hidden' => 'true' ) );
1879 ?>
1880 <?php else : ?>
1881 <div <?php $this->print_render_attribute_string( 'slide_lottie' ); ?>></div>
1882 <?php endif; ?>
1883 </div>
1884 <?php endif; ?>
1885
1886 <?php if ( 'style6' === $settings['premium_button_hover_effect'] && 'yes' === $mouse_detect ) : ?>
1887 <span <?php $this->print_render_attribute_string( 'style6' ); ?>></span>
1888 <?php endif; ?>
1889
1890 <?php if ( 'style8' === $settings['premium_button_hover_effect'] ) : ?>
1891 <?php echo Helper_Functions::get_btn_svgs( $settings['underline_style'] ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
1892 <?php endif; ?>
1893
1894 </a>
1895
1896
1897 <?php
1898 }
1899 }
1900