Plugin Directory

source: qi-addons-for-elementor/tags/1.7.0/inc/shortcodes/button/class-qiaddonsforelementor-button-shortcode.php

Last change on this file was 3077566, checked in by qodeinteractive, 12 months ago
  • added 1.7.0 tag
File size: 43.1 KB
Line 
1<?php
2
3if ( ! defined( 'ABSPATH' ) ) {
4        // Exit if accessed directly.
5        exit;
6}
7
8if ( ! function_exists( 'qi_addons_for_elementor_add_button_shortcode' ) ) {
9        /**
10         * Function that isadding shortcode into shortcodes list for registration
11         *
12         * @param array $shortcodes - Array of registered shortcodes
13         *
14         * @return array
15         */
16        function qi_addons_for_elementor_add_button_shortcode( $shortcodes ) {
17                $shortcodes[] = 'QiAddonsForElementor_Button_Shortcode';
18
19                return $shortcodes;
20        }
21
22        add_filter( 'qi_addons_for_elementor_filter_register_shortcodes', 'qi_addons_for_elementor_add_button_shortcode', 9 );
23}
24
25if ( class_exists( 'QiAddonsForElementor_Shortcode' ) ) {
26        class QiAddonsForElementor_Button_Shortcode extends QiAddonsForElementor_Shortcode {
27
28                public function map_shortcode() {
29                        $this->set_shortcode_path( QI_ADDONS_FOR_ELEMENTOR_SHORTCODES_URL_PATH . '/button' );
30                        $this->set_base( 'qi_addons_for_elementor_button' );
31                        $this->set_name( esc_html__( 'Button', 'qi-addons-for-elementor' ) );
32                        $this->set_description( esc_html__( 'Shortcode that displays button with provided parameters', 'qi-addons-for-elementor' ) );
33                        $this->set_category( esc_html__( 'Qi Addons For Elementor', 'qi-addons-for-elementor' ) );
34                        $this->set_subcategory( esc_html__( 'Typography', 'qi-addons-for-elementor' ) );
35                        $this->set_demo( 'https://qodeinteractive.com/qi-addons-for-elementor/button/' );
36                        $this->set_documentation( 'https://qodeinteractive.com/qi-addons-for-elementor/documentation/#button' );
37                        $this->set_video( 'https://www.youtube.com/watch?v=BW9kZV40eZY' );
38                        $this->set_necessary_styles( qi_addons_for_elementor_icon_necessary_styles() );
39
40                        $this->set_option(
41                                array(
42                                        'field_type' => 'text',
43                                        'name'       => 'custom_class',
44                                        'title'      => esc_html__( 'Custom Class', 'qi-addons-for-elementor' ),
45                                )
46                        );
47
48                        $this->set_option(
49                                array(
50                                        'field_type'    => 'select',
51                                        'name'          => 'button_layout',
52                                        'title'         => esc_html__( 'Layout', 'qi-addons-for-elementor' ),
53                                        'options'       => array(
54                                                'filled'   => esc_html__( 'Filled', 'qi-addons-for-elementor' ),
55                                                'outlined' => esc_html__( 'Outlined', 'qi-addons-for-elementor' ),
56                                                'textual'  => esc_html__( 'Textual', 'qi-addons-for-elementor' ),
57                                        ),
58                                        'default_value' => 'filled',
59                                )
60                        );
61                        $this->set_option(
62                                array(
63                                        'field_type'    => 'select',
64                                        'name'          => 'button_type',
65                                        'title'         => esc_html__( 'Type', 'qi-addons-for-elementor' ),
66                                        'options'       => array(
67                                                'standard'     => esc_html__( 'Standard', 'qi-addons-for-elementor' ),
68                                                'inner-border' => esc_html__( 'With Inner Border', 'qi-addons-for-elementor' ),
69                                                'icon-boxed'   => esc_html__( 'Icon Boxed', 'qi-addons-for-elementor' ),
70                                        ),
71                                        'default_value' => 'standard',
72                                        'dependency'    => array(
73                                                'show' => array(
74                                                        'button_layout' => array(
75                                                                'values'        => array( 'filled', 'outlined' ),
76                                                                'default_value' => 'filled',
77                                                        ),
78                                                ),
79                                        ),
80                                )
81                        );
82                        $this->set_option(
83                                array(
84                                        'field_type'    => 'select',
85                                        'name'          => 'button_underline',
86                                        'title'         => esc_html__( 'Enable Button Text Underline', 'qi-addons-for-elementor' ),
87                                        'options'       => qi_addons_for_elementor_get_select_type_options_pool( 'no_yes', false ),
88                                        'default_value' => 'no',
89                                )
90                        );
91                        $this->set_option(
92                                array(
93                                        'field_type' => 'select',
94                                        'name'       => 'button_size',
95                                        'title'      => esc_html__( 'Size', 'qi-addons-for-elementor' ),
96                                        'options'    => array(
97                                                ''      => esc_html__( 'Normal', 'qi-addons-for-elementor' ),
98                                                'small' => esc_html__( 'Small', 'qi-addons-for-elementor' ),
99                                                'large' => esc_html__( 'Large', 'qi-addons-for-elementor' ),
100                                                'full'  => esc_html__( 'Normal Full Width', 'qi-addons-for-elementor' ),
101                                        ),
102                                        'dependency' => array(
103                                                'hide' => array(
104                                                        'button_layout' => array(
105                                                                'values'        => 'textual',
106                                                                'default_value' => 'filled',
107                                                        ),
108                                                ),
109                                        ),
110                                )
111                        );
112                        $this->set_option(
113                                array(
114                                        'field_type'    => 'text',
115                                        'name'          => 'button_text',
116                                        'title'         => esc_html__( 'Button Text', 'qi-addons-for-elementor' ),
117                                        'default_value' => esc_html__( 'Click Here', 'qi-addons-for-elementor' ),
118                                )
119                        );
120                        $this->set_option(
121                                array(
122                                        'field_type' => 'link',
123                                        'name'       => 'button_link',
124                                        'title'      => esc_html__( 'Button Link', 'qi-addons-for-elementor' ),
125                                )
126                        );
127                        $this->set_option(
128                                array(
129                                        'field_type' => 'typography',
130                                        'name'       => 'button_typography',
131                                        'title'      => esc_html__( 'Typography', 'qi-addons-for-elementor' ),
132                                        'group'      => esc_html__( 'Style', 'qi-addons-for-elementor' ),
133                                        'selector'   => '{{WRAPPER}} .qodef-qi-button',
134                                )
135                        );
136                        $this->set_option(
137                                array(
138                                        'field_type' => 'start_controls_tabs',
139                                        'name'       => 'button_style_tabs',
140                                        'title'      => esc_html__( 'Tabs Start', 'qi-addons-for-elementor' ),
141                                        'group'      => esc_html__( 'Style', 'qi-addons-for-elementor' ),
142                                )
143                        );
144
145                        $this->set_option(
146                                array(
147                                        'field_type' => 'start_controls_tab',
148                                        'name'       => 'button_tab_normal',
149                                        'title'      => esc_html__( 'Normal', 'qi-addons-for-elementor' ),
150                                        'group'      => esc_html__( 'Style', 'qi-addons-for-elementor' ),
151                                )
152                        );
153                        $this->set_option(
154                                array(
155                                        'field_type' => 'color',
156                                        'name'       => 'button_color',
157                                        'title'      => esc_html__( 'Text Color', 'qi-addons-for-elementor' ),
158                                        'group'      => esc_html__( 'Style', 'qi-addons-for-elementor' ),
159                                        'selectors'  => array(
160                                                '{{WRAPPER}} .qodef-qi-button' => 'color: {{VALUE}};',
161                                        ),
162                                )
163                        );
164                        $this->set_option(
165                                array(
166                                        'field_type' => 'color',
167                                        'name'       => 'button_background_color',
168                                        'title'      => esc_html__( 'Background Color', 'qi-addons-for-elementor' ),
169                                        'selectors'  => array(
170                                                '{{WRAPPER}} .qodef-qi-button.qodef-layout--filled' => 'background-color: {{VALUE}};',
171                                        ),
172                                        'dependency' => array(
173                                                'show' => array(
174                                                        'button_layout' => array(
175                                                                'values'        => 'filled',
176                                                                'default_value' => 'filled',
177                                                        ),
178                                                ),
179                                        ),
180                                        'group'      => esc_html__( 'Style', 'qi-addons-for-elementor' ),
181                                )
182                        );
183                        $this->set_option(
184                                array(
185                                        'field_type' => 'color',
186                                        'name'       => 'button_border_color',
187                                        'title'      => esc_html__( 'Border Color', 'qi-addons-for-elementor' ),
188                                        'selectors'  => array(
189                                                '{{WRAPPER}} .qodef-qi-button' => 'border-color: {{VALUE}};',
190                                        ),
191                                        'dependency' => array(
192                                                'hide' => array(
193                                                        'button_layout' => array(
194                                                                'values'        => 'textual',
195                                                                'default_value' => 'filled',
196                                                        ),
197                                                ),
198                                        ),
199                                        'group'      => esc_html__( 'Style', 'qi-addons-for-elementor' ),
200                                )
201                        );
202
203                        $this->set_option(
204                                array(
205                                        'field_type' => 'end_controls_tab',
206                                        'name'       => 'button_tab_normal_end',
207                                        'title'      => esc_html__( 'Normal End', 'qi-addons-for-elementor' ),
208                                        'group'      => esc_html__( 'Style', 'qi-addons-for-elementor' ),
209                                )
210                        );
211                        $this->set_option(
212                                array(
213                                        'field_type' => 'start_controls_tab',
214                                        'name'       => 'button_tab_hover',
215                                        'title'      => esc_html__( 'Hover', 'qi-addons-for-elementor' ),
216                                        'group'      => esc_html__( 'Style', 'qi-addons-for-elementor' ),
217                                )
218                        );
219                        $this->set_option(
220                                array(
221                                        'field_type' => 'color',
222                                        'name'       => 'button_hover_color',
223                                        'title'      => esc_html__( 'Text Hover Color', 'qi-addons-for-elementor' ),
224                                        'group'      => esc_html__( 'Style', 'qi-addons-for-elementor' ),
225                                        'selectors'  => array(
226                                                '{{WRAPPER}} .qodef-qi-button:hover' => 'color: {{VALUE}};',
227                                        ),
228                                )
229                        );
230                        $this->set_option(
231                                array(
232                                        'field_type' => 'color',
233                                        'name'       => 'button_hover_background_color',
234                                        'title'      => esc_html__( 'Background Hover Color', 'qi-addons-for-elementor' ),
235                                        'selectors'  => array(
236                                                '{{WRAPPER}} .qodef-qi-button.qodef-layout--filled:not(.qodef-hover--reveal):hover'   => 'background-color: {{VALUE}};',
237                                                '{{WRAPPER}} .qodef-qi-button.qodef-layout--outlined:not(.qodef-hover--reveal):hover' => 'background-color: {{VALUE}};',
238                                                '{{WRAPPER}} .qodef-qi-button.qodef-layout--filled.qodef-hover--reveal:after'   => 'background-color: {{VALUE}};',
239                                                '{{WRAPPER}} .qodef-qi-button.qodef-layout--outlined.qodef-hover--reveal:after' => 'background-color: {{VALUE}};',
240                                        ),
241                                        'dependency' => array(
242                                                'hide' => array(
243                                                        'button_layout' => array(
244                                                                'values'        => 'textual',
245                                                                'default_value' => 'filled',
246                                                        ),
247                                                ),
248                                        ),
249                                        'group'      => esc_html__( 'Style', 'qi-addons-for-elementor' ),
250                                )
251                        );
252                        $this->set_option(
253                                array(
254                                        'field_type' => 'color',
255                                        'name'       => 'button_hover_border_color',
256                                        'title'      => esc_html__( 'Border Hover Color', 'qi-addons-for-elementor' ),
257                                        'selectors'  => array(
258                                                '{{WRAPPER}} .qodef-qi-button:hover' => 'border-color: {{VALUE}};',
259                                        ),
260                                        'dependency' => array(
261                                                'hide' => array(
262                                                        'button_layout' => array(
263                                                                'values'        => 'textual',
264                                                                'default_value' => 'filled',
265                                                        ),
266                                                ),
267                                        ),
268                                        'group'      => esc_html__( 'Style', 'qi-addons-for-elementor' ),
269                                )
270                        );
271                        $this->set_option(
272                                array(
273                                        'field_type' => 'select',
274                                        'name'       => 'button_reveal_hover',
275                                        'title'      => esc_html__( 'Reveal Background', 'qi-addons-for-elementor' ),
276                                        'group'      => esc_html__( 'Style', 'qi-addons-for-elementor' ),
277                                        'options'    => array(
278                                                ''                  => esc_html__( 'None', 'qi-addons-for-elementor' ),
279                                                'reveal-horizontal' => esc_html__( 'Horizontal', 'qi-addons-for-elementor' ),
280                                                'reveal-vertical'   => esc_html__( 'Vertical', 'qi-addons-for-elementor' ),
281                                        ),
282                                        'dependency' => array(
283                                                'hide' => array(
284                                                        'button_layout' => array(
285                                                                'values'        => 'textual',
286                                                                'default_value' => 'filled',
287                                                        ),
288                                                ),
289                                        ),
290                                )
291                        );
292                        $this->set_option(
293                                array(
294                                        'field_type' => 'end_controls_tab',
295                                        'name'       => 'button_tab_hover_end',
296                                        'title'      => esc_html__( 'Hover End', 'qi-addons-for-elementor' ),
297                                        'group'      => esc_html__( 'Style', 'qi-addons-for-elementor' ),
298                                )
299                        );
300                        $this->set_option(
301                                array(
302                                        'field_type' => 'end_controls_tabs',
303                                        'name'       => 'button_style_tabs_end',
304                                        'title'      => esc_html__( 'Tabs End', 'qi-addons-for-elementor' ),
305                                        'group'      => esc_html__( 'Style', 'qi-addons-for-elementor' ),
306                                )
307                        );
308                        $this->set_option(
309                                array(
310                                        'field_type' => 'divider',
311                                        'name'       => 'item_divider_button_tab_style',
312                                        'title'      => esc_html__( 'Divider', 'qi-addons-for-elementor' ),
313                                        'group'      => esc_html__( 'Style', 'qi-addons-for-elementor' ),
314                                )
315                        );
316                        $this->set_option(
317                                array(
318                                        'field_type' => 'dimensions',
319                                        'name'       => 'button_border_width',
320                                        'title'      => esc_html__( 'Border Width', 'qi-addons-for-elementor' ),
321                                        'responsive' => true,
322                                        'selectors'  => array(
323                                                '{{WRAPPER}} .qodef-qi-button' => 'border-width: {{TOP}}px {{RIGHT}}px {{BOTTOM}}px {{LEFT}}px;',
324                                        ),
325                                        'dependency' => array(
326                                                'show' => array(
327                                                        'button_layout' => array(
328                                                                'values'        => array( 'filled', 'outlined' ),
329                                                                'default_value' => 'filled',
330                                                        ),
331                                                ),
332                                        ),
333                                        'group'      => esc_html__( 'Style', 'qi-addons-for-elementor' ),
334                                )
335                        );
336                        $this->set_option(
337                                array(
338                                        'field_type' => 'dimensions',
339                                        'name'       => 'button_border_radius',
340                                        'title'      => esc_html__( 'Border Radius', 'qi-addons-for-elementor' ),
341                                        'size_units' => array( 'px', '%' ),
342                                        'responsive' => true,
343                                        'selectors'  => array(
344                                                '{{WRAPPER}} .qodef-qi-button' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
345                                        ),
346                                        'dependency' => array(
347                                                'show' => array(
348                                                        'button_layout' => array(
349                                                                'values'        => array( 'filled', 'outlined' ),
350                                                                'default_value' => 'filled',
351                                                        ),
352                                                ),
353                                        ),
354                                        'group'      => esc_html__( 'Style', 'qi-addons-for-elementor' ),
355                                )
356                        );
357                        $this->set_option(
358                                array(
359                                        'field_type' => 'dimensions',
360                                        'name'       => 'button_padding',
361                                        'title'      => esc_html__( 'Padding', 'qi-addons-for-elementor' ),
362                                        'size_units' => array( 'px', '%', 'em' ),
363                                        'responsive' => true,
364                                        'selectors'  => array(
365                                                '{{WRAPPER}} .qodef-qi-button' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
366                                                '{{WRAPPER}} .qodef-qi-button.qodef-type--icon-boxed .qodef-m-text' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
367                                                '{{WRAPPER}} .qodef-qi-button.qodef-type--icon-boxed .qodef-m-icon' => 'padding: {{TOP}}{{UNIT}} 0 {{BOTTOM}}{{UNIT}};',
368                                        ),
369                                        'dependency' => array(
370                                                'show' => array(
371                                                        'button_layout' => array(
372                                                                'values'        => array( 'filled', 'outlined' ),
373                                                                'default_value' => 'filled',
374                                                        ),
375                                                ),
376                                        ),
377                                        'group'      => esc_html__( 'Style', 'qi-addons-for-elementor' ),
378                                )
379                        );
380
381                        // Icon options.
382                        $this->set_option(
383                                array(
384                                        'field_type'    => 'icons',
385                                        'name'          => 'button_icon',
386                                        'title'         => esc_html__( 'Icon', 'qi-addons-for-elementor' ),
387                                        'default_value' => array(),
388                                        'group'         => esc_html__( 'Icon', 'qi-addons-for-elementor' ),
389                                )
390                        );
391
392                        $this->set_option(
393                                array(
394                                        'field_type'    => 'select',
395                                        'name'          => 'button_icon_position',
396                                        'title'         => esc_html__( 'Icon Position', 'qi-addons-for-elementor' ),
397                                        'options'       => array(
398                                                'left'  => esc_html__( 'Left', 'qi-addons-for-elementor' ),
399                                                'right' => esc_html__( 'Right', 'qi-addons-for-elementor' ),
400                                        ),
401                                        'default_value' => 'right',
402                                        'group'         => esc_html__( 'Icon', 'qi-addons-for-elementor' ),
403                                )
404                        );
405
406                        $this->set_option(
407                                array(
408                                        'field_type' => 'slider',
409                                        'name'       => 'button_icon_size',
410                                        'title'      => esc_html__( 'Icon Size', 'qi-addons-for-elementor' ),
411                                        'size_units' => array( 'px', 'em', 'rem', 'vw' ),
412                                        'responsive' => true,
413                                        'selectors'  => array(
414                                                '{{WRAPPER}} .qodef-m-icon'     => 'font-size: {{SIZE}}{{UNIT}};',
415                                                '{{WRAPPER}} .qodef-m-icon svg' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};',
416                                        ),
417                                        'group'      => esc_html__( 'Icon Style', 'qi-addons-for-elementor' ),
418                                )
419                        );
420
421                        $this->set_option(
422                                array(
423                                        'field_type' => 'start_controls_tabs',
424                                        'name'       => 'button_icon_style_tabs',
425                                        'title'      => esc_html__( 'Tabs Start', 'qi-addons-for-elementor' ),
426                                        'group'      => esc_html__( 'Icon Style', 'qi-addons-for-elementor' ),
427                                )
428                        );
429
430                        $this->set_option(
431                                array(
432                                        'field_type' => 'start_controls_tab',
433                                        'name'       => 'button_icon_tab_normal',
434                                        'title'      => esc_html__( 'Normal', 'qi-addons-for-elementor' ),
435                                        'group'      => esc_html__( 'Icon Style', 'qi-addons-for-elementor' ),
436                                )
437                        );
438                        $this->set_option(
439                                array(
440                                        'field_type' => 'color',
441                                        'name'       => 'button_icon_color',
442                                        'title'      => esc_html__( 'Icon Color', 'qi-addons-for-elementor' ),
443                                        'selectors'  => array(
444                                                '{{WRAPPER}} .qodef-m-icon' => 'color: {{VALUE}};',
445                                        ),
446                                        'group'      => esc_html__( 'Icon Style', 'qi-addons-for-elementor' ),
447                                )
448                        );
449
450                        // Icon Background Options (only for icon boxed, when filled and outline layout is chosen).
451                        $this->set_option(
452                                array(
453                                        'field_type' => 'color',
454                                        'name'       => 'button_icon_background_color',
455                                        'title'      => esc_html__( 'Icon Background Color', 'qi-addons-for-elementor' ),
456                                        'selectors'  => array(
457                                                '{{WRAPPER}} .qodef-qi-button.qodef-type--icon-boxed .qodef-m-icon' => 'background-color: {{VALUE}};',
458                                        ),
459                                        'dependency' => array(
460                                                'relation' => 'and',
461                                                'show'     => array(
462                                                        'button_type'   => array(
463                                                                'values'        => 'icon-boxed',
464                                                                'default_value' => 'standard',
465                                                        ),
466                                                        'button_layout' => array(
467                                                                'values'        => array( 'filled', 'outlined' ),
468                                                                'default_value' => 'filled',
469                                                        ),
470                                                ),
471                                        ),
472                                        'group'      => esc_html__( 'Icon Style', 'qi-addons-for-elementor' ),
473                                )
474                        );
475                        $this->set_option(
476                                array(
477                                        'field_type' => 'end_controls_tab',
478                                        'name'       => 'button_tab_icon_normal_end',
479                                        'title'      => esc_html__( 'Normal End', 'qi-addons-for-elementor' ),
480                                        'group'      => esc_html__( 'Icon Style', 'qi-addons-for-elementor' ),
481                                )
482                        );
483
484                        $this->set_option(
485                                array(
486                                        'field_type' => 'start_controls_tab',
487                                        'name'       => 'button_icon_tab_hover',
488                                        'title'      => esc_html__( 'Hover', 'qi-addons-for-elementor' ),
489                                        'group'      => esc_html__( 'Icon Style', 'qi-addons-for-elementor' ),
490                                )
491                        );
492
493                        $this->set_option(
494                                array(
495                                        'field_type' => 'color',
496                                        'name'       => 'button_icon_hover_color',
497                                        'title'      => esc_html__( 'Icon Hover Color', 'qi-addons-for-elementor' ),
498                                        'dependency' => array(
499                                                'hide' => array(
500                                                        'button_icon_color' => array(
501                                                                'values'        => '',
502                                                                'default_value' => '',
503                                                        ),
504                                                ),
505                                        ),
506                                        'selectors'  => array(
507                                                '{{WRAPPER}} .qodef-qi-button:hover .qodef-m-icon' => 'color: {{VALUE}};',
508                                        ),
509                                        'group'      => esc_html__( 'Icon Style', 'qi-addons-for-elementor' ),
510                                )
511                        );
512
513                        $this->set_option(
514                                array(
515                                        'field_type' => 'color',
516                                        'name'       => 'button_icon_background_hover_color',
517                                        'title'      => esc_html__( 'Icon Background Hover Color', 'qi-addons-for-elementor' ),
518                                        'selectors'  => array(
519                                                '{{WRAPPER}} .qodef-qi-button.qodef-type--icon-boxed:not(.qodef-icon-background-hover--reveal):hover .qodef-m-icon'   => 'background-color: {{VALUE}};',
520                                                '{{WRAPPER}} .qodef-qi-button.qodef-type--icon-boxed.qodef-icon-background-hover--reveal .qodef-m-icon:after'   => 'background-color: {{VALUE}};',
521                                        ),
522                                        'dependency' => array(
523                                                'relation' => 'and',
524                                                'show'     => array(
525                                                        'button_type'   => array(
526                                                                'values'        => 'icon-boxed',
527                                                                'default_value' => 'standard',
528                                                        ),
529                                                        'button_layout' => array(
530                                                                'values'        => array( 'filled', 'outlined' ),
531                                                                'default_value' => 'filled',
532                                                        ),
533                                                ),
534                                        ),
535                                        'group'      => esc_html__( 'Icon Style', 'qi-addons-for-elementor' ),
536                                )
537                        );
538
539                        $this->set_option(
540                                array(
541                                        'field_type' => 'select',
542                                        'name'       => 'button_icon_background_hover_reveal',
543                                        'title'      => esc_html__( 'Reveal Background', 'qi-addons-for-elementor' ),
544                                        'group'      => esc_html__( 'Icon Style', 'qi-addons-for-elementor' ),
545                                        'options'    => array(
546                                                ''                  => esc_html__( 'None', 'qi-addons-for-elementor' ),
547                                                'reveal-horizontal' => esc_html__( 'Horizontal', 'qi-addons-for-elementor' ),
548                                                'reveal-vertical'   => esc_html__( 'Vertical', 'qi-addons-for-elementor' ),
549                                        ),
550                                        'dependency' => array(
551                                                'hide' => array(
552                                                        'button_icon_background_hover_color' => array(
553                                                                'values'        => '',
554                                                                'default_value' => '',
555                                                        ),
556                                                ),
557                                        ),
558                                )
559                        );
560
561                        $this->set_option(
562                                array(
563                                        'field_type' => 'select',
564                                        'name'       => 'button_icon_hover_move',
565                                        'title'      => esc_html__( 'Move Icon', 'qi-addons-for-elementor' ),
566                                        'group'      => esc_html__( 'Icon Style', 'qi-addons-for-elementor' ),
567                                        'options'    => array(
568                                                'move-horizontal-short' => esc_html__( 'Horizontal Short', 'qi-addons-for-elementor' ),
569                                                'move-horizontal'       => esc_html__( 'Horizontal', 'qi-addons-for-elementor' ),
570                                                'move-vertical'         => esc_html__( 'Vertical', 'qi-addons-for-elementor' ),
571                                                'move-diagonal'         => esc_html__( 'Diagonal', 'qi-addons-for-elementor' ),
572                                                ''                      => esc_html__( 'None', 'qi-addons-for-elementor' ),
573                                        ),
574                                )
575                        );
576
577                        $this->set_option(
578                                array(
579                                        'field_type' => 'end_controls_tab',
580                                        'name'       => 'button_icon_tab_hover_end',
581                                        'title'      => esc_html__( 'Hover End', 'qi-addons-for-elementor' ),
582                                        'group'      => esc_html__( 'Icon Style', 'qi-addons-for-elementor' ),
583                                )
584                        );
585                        $this->set_option(
586                                array(
587                                        'field_type' => 'end_controls_tabs',
588                                        'name'       => 'button_icon_style_tabs_end',
589                                        'title'      => esc_html__( 'Tabs End', 'qi-addons-for-elementor' ),
590                                        'group'      => esc_html__( 'Icon Style', 'qi-addons-for-elementor' ),
591                                )
592                        );
593                        $this->set_option(
594                                array(
595                                        'field_type' => 'divider',
596                                        'name'       => 'button_icon_margin_divider',
597                                        'title'      => esc_html__( 'Icon Divider', 'qi-addons-for-elementor' ),
598                                        'group'      => esc_html__( 'Icon Style', 'qi-addons-for-elementor' ),
599                                )
600                        );
601
602                        $this->set_option(
603                                array(
604                                        'field_type' => 'dimensions',
605                                        'name'       => 'button_icon_margin',
606                                        'title'      => esc_html__( 'Icon Margin', 'qi-addons-for-elementor' ),
607                                        'group'      => esc_html__( 'Icon Style', 'qi-addons-for-elementor' ),
608                                        'size_units' => array( 'px', '%', 'em' ),
609                                        'responsive' => true,
610                                        'selectors'  => array(
611                                                '{{WRAPPER}} .qodef-m-icon' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
612                                        ),
613                                )
614                        );
615
616                        $this->set_option(
617                                array(
618                                        'field_type' => 'divider',
619                                        'name'       => 'button_icon_border_divider',
620                                        'title'      => esc_html__( 'Icon Divider', 'qi-addons-for-elementor' ),
621                                        'group'      => esc_html__( 'Icon Style', 'qi-addons-for-elementor' ),
622                                )
623                        );
624                        // Icon Side Border Options (only for icon boxed, when filled and outline layout is chosen).
625                        $this->set_option(
626                                array(
627                                        'field_type'    => 'select',
628                                        'name'          => 'button_icon_enable_side_border',
629                                        'title'         => esc_html__( 'Enable Icon Side Border', 'qi-addons-for-elementor' ),
630                                        'options'       => qi_addons_for_elementor_get_select_type_options_pool( 'no_yes', false ),
631                                        'default_value' => 'no',
632                                        'dependency'    => array(
633                                                'relation' => 'and',
634                                                'show'     => array(
635                                                        'button_type'   => array(
636                                                                'values'        => 'icon-boxed',
637                                                                'default_value' => 'standard',
638                                                        ),
639                                                        'button_layout' => array(
640                                                                'values'        => array( 'filled', 'outlined' ),
641                                                                'default_value' => 'filled',
642                                                        ),
643                                                ),
644                                        ),
645                                        'group'         => esc_html__( 'Icon', 'qi-addons-for-elementor' ),
646                                )
647                        );
648
649                        $this->set_option(
650                                array(
651                                        'field_type' => 'color',
652                                        'name'       => 'button_icon_side_color',
653                                        'title'      => esc_html__( 'Icon Side Border Color', 'qi-addons-for-elementor' ),
654                                        'selectors'  => array(
655                                                '{{WRAPPER}} .qodef-m-border' => 'background-color: {{VALUE}};',
656                                        ),
657                                        'dependency' => array(
658                                                'show' => array(
659                                                        'button_icon_enable_side_border' => array(
660                                                                'values'        => 'yes',
661                                                                'default_value' => 'no',
662                                                        ),
663                                                ),
664                                        ),
665                                        'group'      => esc_html__( 'Icon Style', 'qi-addons-for-elementor' ),
666                                )
667                        );
668
669                        $this->set_option(
670                                array(
671                                        'field_type' => 'color',
672                                        'name'       => 'button_icon_side_hover_color',
673                                        'title'      => esc_html__( 'Icon Side Border Hover Color', 'qi-addons-for-elementor' ),
674                                        'selectors'  => array(
675                                                '{{WRAPPER}} .qodef-qi-button.qodef-type--icon-boxed:hover .qodef-m-border' => 'background-color: {{VALUE}};',
676                                        ),
677                                        'dependency' => array(
678                                                'show' => array(
679                                                        'button_icon_enable_side_border' => array(
680                                                                'values'        => 'yes',
681                                                                'default_value' => 'no',
682                                                        ),
683                                                ),
684                                        ),
685                                        'group'      => esc_html__( 'Icon Style', 'qi-addons-for-elementor' ),
686                                )
687                        );
688
689                        $this->set_option(
690                                array(
691                                        'field_type' => 'slider',
692                                        'name'       => 'button_icon_side_height',
693                                        'title'      => esc_html__( 'Icon Side Border Height', 'qi-addons-for-elementor' ),
694                                        'size_units' => array( 'px' ),
695                                        'responsive' => true,
696                                        'selectors'  => array(
697                                                '{{WRAPPER}} .qodef-m-border' => 'height: {{SIZE}}{{UNIT}}; align-self: center;',
698                                        ),
699                                        'dependency' => array(
700                                                'show' => array(
701                                                        'button_icon_enable_side_border' => array(
702                                                                'values'        => 'yes',
703                                                                'default_value' => 'no',
704                                                        ),
705                                                ),
706                                        ),
707                                        'group'      => esc_html__( 'Icon Style', 'qi-addons-for-elementor' ),
708                                )
709                        );
710
711                        $this->set_option(
712                                array(
713                                        'field_type' => 'slider',
714                                        'name'       => 'button_icon_side_width',
715                                        'title'      => esc_html__( 'Icon Side Border Width', 'qi-addons-for-elementor' ),
716                                        'size_units' => array( 'px' ),
717                                        'responsive' => true,
718                                        'range'      => array(
719                                                'px' => array(
720                                                        'min' => 0,
721                                                        'max' => 10,
722                                                ),
723                                        ),
724                                        'selectors'  => array(
725                                                '{{WRAPPER}} .qodef-m-border' => 'width: {{SIZE}}{{UNIT}};',
726                                        ),
727                                        'dependency' => array(
728                                                'show' => array(
729                                                        'button_icon_enable_side_border' => array(
730                                                                'values'        => 'yes',
731                                                                'default_value' => 'no',
732                                                        ),
733                                                ),
734                                        ),
735                                        'group'      => esc_html__( 'Icon Style', 'qi-addons-for-elementor' ),
736                                )
737                        );
738
739                        // Button Inner Border Options (only for inner border type, when filled and outline layout is chosen).
740                        $this->set_option(
741                                array(
742                                        'field_type' => 'start_controls_tabs',
743                                        'name'       => 'button_inner_border_style_tabs',
744                                        'title'      => esc_html__( 'Inner Border Start', 'qi-addons-for-elementor' ),
745                                        'group'      => esc_html__( 'Inner Border Style', 'qi-addons-for-elementor' ),
746                                )
747                        );
748
749                        $this->set_option(
750                                array(
751                                        'field_type' => 'start_controls_tab',
752                                        'name'       => 'button_inner_border_normal',
753                                        'title'      => esc_html__( 'Normal', 'qi-addons-for-elementor' ),
754                                        'group'      => esc_html__( 'Inner Border Style', 'qi-addons-for-elementor' ),
755                                )
756                        );
757
758                        $this->set_option(
759                                array(
760                                        'field_type' => 'color',
761                                        'name'       => 'button_inner_border_color',
762                                        'title'      => esc_html__( 'Inner Border Color', 'qi-addons-for-elementor' ),
763                                        'selectors'  => array(
764                                                '{{WRAPPER}} .qodef-m-inner-border' => 'color: {{VALUE}};',
765                                        ),
766                                        'dependency' => array(
767                                                'relation' => 'and',
768                                                'show'     => array(
769                                                        'button_type'   => array(
770                                                                'values'        => 'inner-border',
771                                                                'default_value' => 'standard',
772                                                        ),
773                                                        'button_layout' => array(
774                                                                'values'        => array( 'filled', 'outlined' ),
775                                                                'default_value' => 'filled',
776                                                        ),
777                                                ),
778                                        ),
779                                        'group'      => esc_html__( 'Inner Border Style', 'qi-addons-for-elementor' ),
780                                )
781                        );
782
783                        $this->set_option(
784                                array(
785                                        'field_type' => 'end_controls_tab',
786                                        'name'       => 'button_inner_border_normal_end',
787                                        'title'      => esc_html__( 'Normal End', 'qi-addons-for-elementor' ),
788                                        'group'      => esc_html__( 'Inner Border Style', 'qi-addons-for-elementor' ),
789                                )
790                        );
791
792                        $this->set_option(
793                                array(
794                                        'field_type' => 'start_controls_tab',
795                                        'name'       => 'button_inner_border_hover',
796                                        'title'      => esc_html__( 'Hover', 'qi-addons-for-elementor' ),
797                                        'group'      => esc_html__( 'Inner Border Style', 'qi-addons-for-elementor' ),
798                                )
799                        );
800
801                        $this->set_option(
802                                array(
803                                        'field_type' => 'color',
804                                        'name'       => 'button_inner_border_hover_color',
805                                        'title'      => esc_html__( 'Inner Border Hover Color', 'qi-addons-for-elementor' ),
806                                        'selectors'  => array(
807                                                '{{WRAPPER}} .qodef-qi-button.qodef-type--inner-border:not(.qodef-inner-border-hover--draw):hover .qodef-m-inner-border:not(.qodef-m-inner-border-copy)' => 'color: {{VALUE}};',
808                                                '{{WRAPPER}} .qodef-qi-button.qodef-type--inner-border .qodef-m-inner-border.qodef-m-inner-border-copy' => 'color: {{VALUE}};',
809                                        ),
810                                        'dependency' => array(
811                                                'relation' => 'and',
812                                                'show'     => array(
813                                                        'button_type'   => array(
814                                                                'values'        => 'inner-border',
815                                                                'default_value' => 'standard',
816                                                        ),
817                                                        'button_layout' => array(
818                                                                'values'        => array( 'filled', 'outlined' ),
819                                                                'default_value' => 'filled',
820                                                        ),
821                                                ),
822                                        ),
823                                        'group'      => esc_html__( 'Inner Border Style', 'qi-addons-for-elementor' ),
824                                )
825                        );
826
827                        $this->set_option(
828                                array(
829                                        'field_type' => 'select',
830                                        'name'       => 'button_inner_border_hover_type',
831                                        'title'      => esc_html__( 'Hover', 'qi-addons-for-elementor' ),
832                                        'group'      => esc_html__( 'Inner Border Style', 'qi-addons-for-elementor' ),
833                                        'options'    => array(
834                                                ''                           => esc_html__( 'Change Color', 'qi-addons-for-elementor' ),
835                                                'draw q-draw-center'         => esc_html__( 'Draw From Center', 'qi-addons-for-elementor' ),
836                                                'draw q-draw-one-point'      => esc_html__( 'Draw From One Point', 'qi-addons-for-elementor' ),
837                                                'draw q-draw-two-points'     => esc_html__( 'Draw From Two Points', 'qi-addons-for-elementor' ),
838                                                'remove q-remove-center'     => esc_html__( 'Remove To Center', 'qi-addons-for-elementor' ),
839                                                'remove q-remove-one-point'  => esc_html__( 'Remove To One Point', 'qi-addons-for-elementor' ),
840                                                'remove q-remove-two-points' => esc_html__( 'Remove To Two Points', 'qi-addons-for-elementor' ),
841                                                'move-outer-edge'            => esc_html__( 'Move To Outer Edge', 'qi-addons-for-elementor' ),
842                                        ),
843                                        'dependency' => array(
844                                                'relation' => 'and',
845                                                'show'     => array(
846                                                        'button_type'   => array(
847                                                                'values'        => 'inner-border',
848                                                                'default_value' => 'standard',
849                                                        ),
850                                                        'button_layout' => array(
851                                                                'values'        => array( 'filled', 'outlined' ),
852                                                                'default_value' => 'filled',
853                                                        ),
854                                                ),
855                                        ),
856                                )
857                        );
858
859                        $this->set_option(
860                                array(
861                                        'field_type' => 'end_controls_tab',
862                                        'name'       => 'button_inner_border_hover_end',
863                                        'title'      => esc_html__( 'Hover End', 'qi-addons-for-elementor' ),
864                                        'group'      => esc_html__( 'Inner Border Style', 'qi-addons-for-elementor' ),
865                                )
866                        );
867
868                        $this->set_option(
869                                array(
870                                        'field_type' => 'end_controls_tabs',
871                                        'name'       => 'button_inner_border_style_tabs_end',
872                                        'title'      => esc_html__( 'Inner Border End', 'qi-addons-for-elementor' ),
873                                        'group'      => esc_html__( 'Inner Border Style', 'qi-addons-for-elementor' ),
874                                )
875                        );
876
877                        $this->set_option(
878                                array(
879                                        'field_type' => 'divider',
880                                        'name'       => 'button_inner_border_divider',
881                                        'title'      => esc_html__( 'Inner Border Divider', 'qi-addons-for-elementor' ),
882                                        'group'      => esc_html__( 'Inner Border Style', 'qi-addons-for-elementor' ),
883                                )
884                        );
885
886                        $this->set_option(
887                                array(
888                                        'field_type' => 'slider',
889                                        'name'       => 'button_inner_border_offset',
890                                        'title'      => esc_html__( 'Inner Border Offset', 'qi-addons-for-elementor' ),
891                                        'size_units' => array( 'px', '%' ),
892                                        'responsive' => true,
893                                        'range'      => array(
894                                                'px' => array(
895                                                        'min' => 1,
896                                                        'max' => 30,
897                                                ),
898                                        ),
899                                        'selectors'  => array(
900                                                '{{WRAPPER}} .qodef-m-inner-border' => 'font-size: {{SIZE}}{{UNIT}};',
901                                        ),
902                                        'dependency' => array(
903                                                'relation' => 'and',
904                                                'show'     => array(
905                                                        'button_type'   => array(
906                                                                'values'        => 'inner-border',
907                                                                'default_value' => 'standard',
908                                                        ),
909                                                        'button_layout' => array(
910                                                                'values'        => array( 'filled', 'outlined' ),
911                                                                'default_value' => 'filled',
912                                                        ),
913                                                ),
914                                        ),
915                                        'group'      => esc_html__( 'Inner Border Style', 'qi-addons-for-elementor' ),
916                                )
917                        );
918
919                        $this->set_option(
920                                array(
921                                        'field_type' => 'slider',
922                                        'name'       => 'button_inner_border_width',
923                                        'title'      => esc_html__( 'Inner Border Width', 'qi-addons-for-elementor' ),
924                                        'size_units' => array( 'px' ),
925                                        'responsive' => true,
926                                        'range'      => array(
927                                                'px' => array(
928                                                        'min' => 1,
929                                                        'max' => 10,
930                                                ),
931                                        ),
932                                        'selectors'  => array(
933                                                '{{WRAPPER}} .qodef-m-border-top'  => 'height: {{SIZE}}{{UNIT}};',
934                                                '{{WRAPPER}} .qodef-m-border-right' => 'width: {{SIZE}}{{UNIT}};',
935                                                '{{WRAPPER}} .qodef-m-border-bottom' => 'height: {{SIZE}}{{UNIT}};',
936                                                '{{WRAPPER}} .qodef-m-border-left' => 'width: {{SIZE}}{{UNIT}};',
937                                                '{{WRAPPER}} .qodef-inner-border-hover--move-outer-edge .qodef-m-inner-border' => 'border-width: {{SIZE}}{{UNIT}};',
938                                        ),
939                                        'dependency' => array(
940                                                'relation' => 'and',
941                                                'show'     => array(
942                                                        'button_type'   => array(
943                                                                'values'        => 'inner-border',
944                                                                'default_value' => 'standard',
945                                                        ),
946                                                        'button_layout' => array(
947                                                                'values'        => array( 'filled', 'outlined' ),
948                                                                'default_value' => 'filled',
949                                                        ),
950                                                ),
951                                        ),
952                                        'group'      => esc_html__( 'Inner Border Style', 'qi-addons-for-elementor' ),
953                                )
954                        );
955
956                        // Button Underline Options.
957                        $this->set_option(
958                                array(
959                                        'field_type' => 'start_controls_tabs',
960                                        'name'       => 'button_underline_style_tabs',
961                                        'title'      => esc_html__( 'Tabs Start', 'qi-addons-for-elementor' ),
962                                        'group'      => esc_html__( 'Underline Style', 'qi-addons-for-elementor' ),
963                                )
964                        );
965
966                        $this->set_option(
967                                array(
968                                        'field_type' => 'start_controls_tab',
969                                        'name'       => 'button_underline_tab_normal',
970                                        'title'      => esc_html__( 'Normal', 'qi-addons-for-elementor' ),
971                                        'group'      => esc_html__( 'Underline Style', 'qi-addons-for-elementor' ),
972                                )
973                        );
974                        $this->set_option(
975                                array(
976                                        'field_type' => 'color',
977                                        'name'       => 'button_underline_color',
978                                        'title'      => esc_html__( 'Underline Color', 'qi-addons-for-elementor' ),
979                                        'selectors'  => array(
980                                                '{{WRAPPER}} .qodef-m-text:after' => 'background-color: {{VALUE}};',
981                                        ),
982                                        'dependency' => array(
983                                                'show' => array(
984                                                        'button_underline' => array(
985                                                                'values'        => 'yes',
986                                                                'default_value' => 'no',
987                                                        ),
988                                                ),
989                                        ),
990                                        'group'      => esc_html__( 'Underline Style', 'qi-addons-for-elementor' ),
991                                )
992                        );
993                        $this->set_option(
994                                array(
995                                        'field_type' => 'slider',
996                                        'name'       => 'button_underline_width',
997                                        'title'      => esc_html__( 'Underline Width', 'qi-addons-for-elementor' ),
998                                        'size_units' => array( 'px', '%' ),
999                                        'responsive' => true,
1000                                        'selectors'  => array(
1001                                                '{{WRAPPER}} .qodef-m-text:after' => 'width: {{SIZE}}{{UNIT}};',
1002                                        ),
1003                                        'dependency' => array(
1004                                                'show' => array(
1005                                                        'button_underline' => array(
1006                                                                'values'        => 'yes',
1007                                                                'default_value' => 'no',
1008                                                        ),
1009                                                ),
1010                                        ),
1011                                        'group'      => esc_html__( 'Underline Style', 'qi-addons-for-elementor' ),
1012                                )
1013                        );
1014                        $this->set_option(
1015                                array(
1016                                        'field_type' => 'end_controls_tab',
1017                                        'name'       => 'button_underline_tab_normal_end',
1018                                        'title'      => esc_html__( 'Normal End', 'qi-addons-for-elementor' ),
1019                                        'group'      => esc_html__( 'Underline Style', 'qi-addons-for-elementor' ),
1020                                )
1021                        );
1022                        $this->set_option(
1023                                array(
1024                                        'field_type' => 'start_controls_tab',
1025                                        'name'       => 'button_underline_tab_hover',
1026                                        'title'      => esc_html__( 'Hover', 'qi-addons-for-elementor' ),
1027                                        'group'      => esc_html__( 'Underline Style', 'qi-addons-for-elementor' ),
1028                                )
1029                        );
1030                        $this->set_option(
1031                                array(
1032                                        'field_type' => 'color',
1033                                        'name'       => 'button_underline_hover_color',
1034                                        'title'      => esc_html__( 'Underline Hover Color', 'qi-addons-for-elementor' ),
1035                                        'selectors'  => array(
1036                                                '{{WRAPPER}} .qodef-qi-button.qodef-text-underline:hover .qodef-m-text:after' => 'background-color: {{VALUE}};',
1037                                        ),
1038                                        'dependency' => array(
1039                                                'show' => array(
1040                                                        'button_underline' => array(
1041                                                                'values'        => 'yes',
1042                                                                'default_value' => 'no',
1043                                                        ),
1044                                                ),
1045                                        ),
1046                                        'group'      => esc_html__( 'Underline Style', 'qi-addons-for-elementor' ),
1047                                )
1048                        );
1049                        $this->set_option(
1050                                array(
1051                                        'field_type' => 'slider',
1052                                        'name'       => 'button_underline_hover_width',
1053                                        'title'      => esc_html__( 'Underline Hover Width', 'qi-addons-for-elementor' ),
1054                                        'size_units' => array( 'px', '%' ),
1055                                        'responsive' => true,
1056                                        'selectors'  => array(
1057                                                '{{WRAPPER}} .qodef-qi-button.qodef-text-underline:hover .qodef-m-text:after' => 'width: {{SIZE}}{{UNIT}};',
1058                                        ),
1059                                        'dependency' => array(
1060                                                'relation' => 'and',
1061                                                'hide'     => array(
1062                                                        'button_underline_draw' => array(
1063                                                                'values'        => 'yes',
1064                                                                'default_value' => 'no',
1065                                                        ),
1066                                                        'button_underline'      => array(
1067                                                                'values'        => 'no',
1068                                                                'default_value' => 'no',
1069                                                        ),
1070                                                ),
1071                                        ),
1072                                        'group'      => esc_html__( 'Underline Style', 'qi-addons-for-elementor' ),
1073                                )
1074                        );
1075                        $this->set_option(
1076                                array(
1077                                        'field_type'    => 'select',
1078                                        'name'          => 'button_underline_draw',
1079                                        'title'         => esc_html__( 'Enable Hover Underline Draw', 'qi-addons-for-elementor' ),
1080                                        'options'       => qi_addons_for_elementor_get_select_type_options_pool( 'no_yes' ),
1081                                        'default_value' => 'no',
1082                                        'dependency'    => array(
1083                                                'show' => array(
1084                                                        'button_underline_alignment' => array(
1085                                                                'values'        => array( 'left', 'right' ),
1086                                                                'default_value' => 'left',
1087                                                        ),
1088                                                ),
1089                                        ),
1090                                        'group'         => esc_html__( 'Underline Style', 'qi-addons-for-elementor' ),
1091                                )
1092                        );
1093                        $this->set_option(
1094                                array(
1095                                        'field_type' => 'end_controls_tab',
1096                                        'name'       => 'button_underline_tab_hover_end',
1097                                        'title'      => esc_html__( 'Hover End', 'qi-addons-for-elementor' ),
1098                                        'group'      => esc_html__( 'Underline Style', 'qi-addons-for-elementor' ),
1099                                )
1100                        );
1101                        $this->set_option(
1102                                array(
1103                                        'field_type' => 'end_controls_tabs',
1104                                        'name'       => 'button_underline_style_tabs_end',
1105                                        'title'      => esc_html__( 'Underline End', 'qi-addons-for-elementor' ),
1106                                        'group'      => esc_html__( 'Underline Style', 'qi-addons-for-elementor' ),
1107                                )
1108                        );
1109                        $this->set_option(
1110                                array(
1111                                        'field_type' => 'divider',
1112                                        'name'       => 'item_divider_button_tab_underline_style',
1113                                        'title'      => esc_html__( 'Divider', 'qi-addons-for-elementor' ),
1114                                        'group'      => esc_html__( 'Underline Style', 'qi-addons-for-elementor' ),
1115                                )
1116                        );
1117                        $this->set_option(
1118                                array(
1119                                        'field_type' => 'slider',
1120                                        'name'       => 'button_underline_offset',
1121                                        'title'      => esc_html__( 'Underline Offset', 'qi-addons-for-elementor' ),
1122                                        'size_units' => array( 'px' ),
1123                                        'responsive' => true,
1124                                        'range'      => array(
1125                                                'px' => array(
1126                                                        'min' => -20,
1127                                                        'max' => 20,
1128                                                ),
1129                                        ),
1130                                        'selectors'  => array(
1131                                                '{{WRAPPER}} .qodef-m-text:after' => 'bottom: {{SIZE}}{{UNIT}};',
1132                                        ),
1133                                        'dependency' => array(
1134                                                'show' => array(
1135                                                        'button_underline' => array(
1136                                                                'values'        => 'yes',
1137                                                                'default_value' => 'no',
1138                                                        ),
1139                                                ),
1140                                        ),
1141                                        'group'      => esc_html__( 'Underline Style', 'qi-addons-for-elementor' ),
1142                                )
1143                        );
1144                        $this->set_option(
1145                                array(
1146                                        'field_type' => 'slider',
1147                                        'name'       => 'button_underline_thickness',
1148                                        'title'      => esc_html__( 'Underline Thickness', 'qi-addons-for-elementor' ),
1149                                        'size_units' => array( 'px', '%' ),
1150                                        'responsive' => true,
1151                                        'selectors'  => array(
1152                                                '{{WRAPPER}} .qodef-m-text:after' => 'height: {{SIZE}}{{UNIT}};',
1153                                        ),
1154                                        'dependency' => array(
1155                                                'show' => array(
1156                                                        'button_underline' => array(
1157                                                                'values'        => 'yes',
1158                                                                'default_value' => 'no',
1159                                                        ),
1160                                                ),
1161                                        ),
1162                                        'group'      => esc_html__( 'Underline Style', 'qi-addons-for-elementor' ),
1163                                )
1164                        );
1165
1166                        $this->set_option(
1167                                array(
1168                                        'field_type' => 'select',
1169                                        'name'       => 'button_underline_alignment',
1170                                        'title'      => esc_html__( 'Underline Alignment', 'qi-addons-for-elementor' ),
1171                                        'options'    => array(
1172                                                'left'   => esc_html__( 'Left', 'qi-addons-for-elementor' ),
1173                                                'right'  => esc_html__( 'Right', 'qi-addons-for-elementor' ),
1174                                                'center' => esc_html__( 'Center', 'qi-addons-for-elementor' ),
1175                                        ),
1176                                        'dependency' => array(
1177                                                'show' => array(
1178                                                        'button_underline' => array(
1179                                                                'values'        => 'yes',
1180                                                                'default_value' => 'no',
1181                                                        ),
1182                                                ),
1183                                        ),
1184                                        'group'      => esc_html__( 'Underline Style', 'qi-addons-for-elementor' ),
1185                                )
1186                        );
1187
1188                        $this->set_option(
1189                                array(
1190                                        'field_type' => 'array',
1191                                        'name'       => 'custom_attrs',
1192                                        'title'      => esc_html__( 'Custom Data Attributes', 'qi-addons-for-elementor' ),
1193                                        'visibility' => array(
1194                                                'map_for_page_builder' => false,
1195                                        ),
1196                                )
1197                        );
1198                }
1199
1200                public function load_assets() {
1201                        parent::load_assets();
1202
1203                        qi_addons_for_elementor_icon_load_assets();
1204                }
1205
1206                public static function call_shortcode( $params ) {
1207                        $html = qi_addons_for_elementor_framework_call_shortcode( 'qi_addons_for_elementor_button', $params );
1208                        $html = str_replace( "\n", '', $html );
1209
1210                        return $html;
1211                }
1212
1213                public function render( $options, $content = null ) {
1214
1215                        parent::render( $options );
1216                        $atts = $this->get_atts();
1217
1218                        $atts['type']           = $this->get_button_type( $atts );
1219                        $atts['holder_classes'] = $this->get_holder_classes( $atts );
1220                        $atts['data_attrs']     = $this->get_data_attrs( $atts );
1221                        $atts['icon_classes']   = $this->get_icon_classes( $atts );
1222
1223                        return qi_addons_for_elementor_get_template_part( 'shortcodes/button', 'variations/' . $atts['type'] . '/templates/button', '', $atts );
1224                }
1225
1226                private function get_holder_classes( $atts ) {
1227                        $holder_classes = $this->init_holder_classes();
1228
1229                        $holder_classes[] = 'qodef-qi-button';
1230                        $holder_classes[] = 'qodef-html--link';
1231                        $holder_classes[] = ! empty( $atts['button_layout'] ) ? 'qodef-layout--' . $atts['button_layout'] : '';
1232                        $holder_classes[] = ! empty( $atts['button_type'] ) ? 'qodef-type--' . $atts['button_type'] : '';
1233                        $holder_classes[] = ! empty( $atts['button_size'] ) ? 'qodef-size--' . $atts['button_size'] : '';
1234                        $holder_classes[] = ! empty( $atts['button_reveal_hover'] ) ? 'qodef-hover--reveal qodef--' . $atts['button_reveal_hover'] : '';
1235                        $holder_classes[] = ! empty( $atts['button_icon_position'] ) ? 'qodef-icon--' . $atts['button_icon_position'] : '';
1236                        $holder_classes[] = ! empty( $atts['button_icon_hover_move'] ) ? 'qodef-hover--icon-' . $atts['button_icon_hover_move'] : '';
1237                        $holder_classes[] = ! empty( $atts['button_icon_background_hover_reveal'] ) ? 'qodef-icon-background-hover--reveal qodef-icon-background-hover--' . $atts['button_icon_background_hover_reveal'] : '';
1238                        $holder_classes[] = ! empty( $atts['button_inner_border_hover_type'] ) ? 'qodef-inner-border-hover--' . $atts['button_inner_border_hover_type'] : '';
1239                        $holder_classes[] = 'yes' === $atts['button_underline'] ? 'qodef-text-underline' : '';
1240                        $holder_classes[] = ! empty( $atts['button_underline_alignment'] ) ? 'qodef-underline--' . $atts['button_underline_alignment'] : '';
1241                        $holder_classes[] = 'yes' === $atts['button_underline_draw'] ? 'qodef-button-underline-draw' : '';
1242
1243                        return implode( ' ', $holder_classes );
1244                }
1245
1246                private function get_icon_classes( $atts ) {
1247                        $icon_classes[] = 'qodef-m-icon';
1248                        $icon_classes[] = ! empty( $atts['button_icon_color'] ) ? 'qodef--icon-color-set' : '';
1249
1250                        return implode( ' ', $icon_classes );
1251                }
1252
1253                private function get_data_attrs( $atts ) {
1254                        $data = qi_addons_for_elementor_get_link_attributes( $atts['button_link'] );
1255
1256                        if ( ! empty( $atts['custom_attrs'] ) && is_array( $atts['custom_attrs'] ) ) {
1257                                $data = array_merge( $data, $atts['custom_attrs'] );
1258                        }
1259
1260                        return $data;
1261                }
1262
1263                private function get_button_type( $atts ) {
1264
1265                        if ( 'textual' === $atts['button_layout'] ) {
1266                                $type = 'standard';
1267                        } else {
1268                                $type = $atts['button_type'];
1269                        }
1270
1271                        return $type;
1272                }
1273        }
1274}
Note: See TracBrowser for help on using the repository browser.