PluginProbe ʕ •ᴥ•ʔ
Essential Addons for Elementor – Popular Elementor Templates & Widgets / 5.1.4
Essential Addons for Elementor – Popular Elementor Templates & Widgets v5.1.4
6.6.5 6.6.4 6.6.3 5.7.3 5.7.4 5.8.0 5.8.1 5.8.10 5.8.11 5.8.12 5.8.13 5.8.14 5.8.15 5.8.16 5.8.18 5.8.2 5.8.3 5.8.4 5.8.5 5.8.6 5.8.7 5.8.8 5.8.9 5.9.0 5.9.1 5.9.10 5.9.11 5.9.12 5.9.13 5.9.14 5.9.15 5.9.16 5.9.17 5.9.18 5.9.19 5.9.2 5.9.20 5.9.21 5.9.22 5.9.23 5.9.24 5.9.25 5.9.26 5.9.27 5.9.3 5.9.4 5.9.5 5.9.6 5.9.7 5.9.8 5.9.9 6.0.0 6.0.1 6.0.10 6.0.11 6.0.12 6.0.13 6.0.14 6.0.15 6.0.2 6.0.3 6.0.4 6.0.5 6.0.6 6.0.7 6.0.8 6.0.9 6.1.0 6.1.1 6.1.10 6.1.11 trunk 6.1.12 1.0.0 6.1.13 1.0.1 6.1.14 1.1.0 6.1.15 2.0 6.1.17 2.1 6.1.18 2.10.0 6.1.19 2.10.1 6.1.2 2.10.2 6.1.20 2.10.3 6.1.3 2.10.4 6.1.4 2.10.5 6.1.5 2.2.0 6.1.6 2.2.1 6.1.7 2.2.2 6.1.8 2.2.3 6.1.9 2.2.4 6.2.0 2.2.5 6.2.1 2.3.0 6.2.2 2.3.1 6.2.3 2.4.0 6.2.4 2.4.1 6.3.0 2.4.2 6.3.1 2.4.3 6.3.2 2.5.0 6.3.3 2.6.0 6.4.0 2.7.0 6.5.0 2.7.1 6.5.1 2.7.10 6.5.10 2.7.11 6.5.11 2.7.2 6.5.12 2.7.3 6.5.13 2.7.4 6.5.2 2.7.5 6.5.3 2.7.6 6.5.4 2.7.7 6.5.5 2.7.8 6.5.6 2.7.9 6.5.7 2.8.0 6.5.8 2.8.1 6.5.9 2.8.2 6.6.0 2.8.3 6.6.1 2.8.4 6.6.2 2.8.5 2.8.6 2.8.7 2.9.0 2.9.1 2.9.2 2.9.3 2.9.4 2.9.5 2.9.6 2.9.7 2.9.8 2.9.9 3.0.0 3.0.1 3.0.2 3.0.3 3.0.4 3.0.5 3.1.0 3.1.1 3.1.2 3.1.3 3.1.4 3.1.4.1 3.1.5 3.2.0 3.3.0 3.3.1 3.3.2 3.3.3 3.4.0 3.5.0 3.5.1 3.5.2 3.6.0 3.6.1 3.6.2 3.7.0 3.7.1 3.7.2 3.8.0 3.8.1 3.8.2 3.8.3 3.8.4 3.8.5 3.9.0 3.9.1 3.9.2 3.9.3 3.9.4 4.0.0 4.0.1 4.0.2 4.0.3 4.0.4 4.1.0 4.1.1 4.1.2 4.2.0 4.2.1 4.2.2 4.2.3 4.2.4 4.3.0 4.3.1 4.3.2 4.3.3 4.3.4 4.3.5 4.3.6 4.3.7 4.3.8 4.3.9 4.4.0 4.4.1 4.5.0 4.5.1 4.5.2 4.5.3 4.5.4 4.5.5 4.6.0 4.6.1 4.6.2 4.6.3 4.6.4 4.6.5 4.6.6 4.7.0 4.7.1 4.7.2 4.7.3 4.7.4 4.7.5 4.8.0 4.8.1 4.8.2 4.8.3 4.8.4 4.9.0 4.9.1 4.9.2 4.9.3 4.9.4 4.9.5 4.9.6 4.9.7 5.0.0 5.0.1 5.0.10 5.0.11 5.0.12 5.0.13 5.0.2 5.0.3 5.0.4 5.0.5 5.0.6 5.0.7 5.0.8 5.0.9 5.1.0 5.1.1 5.1.2 5.1.3 5.1.4 5.1.5 5.1.6 5.1.7 5.1.8 5.1.9 5.2.0 5.2.1 5.2.2 5.2.3 5.2.4 5.3.0 5.3.1 5.3.2 5.4.6 5.5.5 5.6.5 5.7.2
essential-addons-for-elementor-lite / includes / Elements / Creative_Button.php
essential-addons-for-elementor-lite / includes / Elements Last commit date
Adv_Accordion.php 4 years ago Adv_Tabs.php 4 years ago Advanced_Data_Table.php 4 years ago Better_Payment.php 4 years ago Betterdocs_Category_Box.php 4 years ago Betterdocs_Category_Grid.php 4 years ago Betterdocs_Search_Form.php 4 years ago Caldera_Forms.php 4 years ago Career_Page.php 4 years ago Contact_Form_7.php 4 years ago Content_Ticker.php 4 years ago Countdown.php 4 years ago Creative_Button.php 4 years ago Crowdfundly_All_Campaign.php 4 years ago Crowdfundly_Organization.php 4 years ago Crowdfundly_Single_Campaign.php 4 years ago Cta_Box.php 4 years ago Data_Table.php 4 years ago Dual_Color_Header.php 4 years ago EmbedPress.php 4 years ago Event_Calendar.php 4 years ago Facebook_Feed.php 4 years ago Fancy_Text.php 4 years ago Feature_List.php 4 years ago Filterable_Gallery.php 4 years ago Flip_Box.php 4 years ago FluentForm.php 4 years ago Formstack.php 4 years ago GravityForms.php 4 years ago Image_Accordion.php 4 years ago Info_Box.php 4 years ago Interactive_Circle.php 4 years ago Login_Register.php 4 years ago NinjaForms.php 4 years ago Post_Grid.php 4 years ago Post_Timeline.php 4 years ago Pricing_Table.php 4 years ago Product_Grid.php 4 years ago Progress_Bar.php 4 years ago Simple_Menu.php 4 years ago Sticky_Video.php 4 years ago Team_Member.php 4 years ago Testimonial.php 4 years ago Tooltip.php 4 years ago Twitter_Feed.php 4 years ago TypeForm.php 4 years ago WeForms.php 4 years ago Woo_Cart.php 4 years ago Woo_Checkout.php 4 years ago Woo_Product_Carousel.php 4 years ago Woo_Product_Compare.php 4 years ago Woo_Product_Gallery.php 4 years ago Woocommerce_Review.php 4 years ago WpForms.php 4 years ago
Creative_Button.php
617 lines
1 <?php
2
3 namespace Essential_Addons_Elementor\Elements;
4
5 // If this file is called directly, abort.
6 if (!defined('ABSPATH')) {
7 exit;
8 }
9
10 use \Elementor\Controls_Manager;
11 use \Elementor\Group_Control_Background;
12 use \Elementor\Group_Control_Border;
13 use \Elementor\Group_Control_Box_Shadow;
14 use \Elementor\Group_Control_Typography;
15 use Elementor\Icons_Manager;
16 use Elementor\Modules\DynamicTags\Module as TagsModule;
17 use \Elementor\Core\Schemes\Typography;
18 use \Elementor\Widget_Base;
19 use Essential_Addons_Elementor\Classes\Helper;
20
21
22 class Creative_Button extends Widget_Base
23 {
24
25 public function get_name()
26 {
27 return 'eael-creative-button';
28 }
29
30 public function get_title()
31 {
32 return esc_html__('Creative Button', 'essential-addons-for-elementor-lite');
33 }
34
35 public function get_icon()
36 {
37 return 'eaicon-creative-button';
38 }
39
40 public function get_categories()
41 {
42 return ['essential-addons-elementor'];
43 }
44
45 public function get_keywords()
46 {
47 return [
48 'button',
49 'ea button',
50 'creative button',
51 'ea creative button',
52 'cta',
53 'call to action',
54 'ea',
55 'marketing button',
56 'essential addons',
57 ];
58 }
59
60 public function get_custom_help_url()
61 {
62 return 'https://essential-addons.com/elementor/docs/creative-buttons/';
63 }
64
65 protected function register_controls()
66 {
67
68 if ( !apply_filters( 'eael/pro_enabled', false ) ) {
69 // Content Controls
70 $this->start_controls_section(
71 'eael_section_creative_button_content',
72 [
73 'label' => esc_html__('Button Content', 'essential-addons-for-elementor-lite'),
74 ]
75 );
76
77 $this->add_control(
78 'creative_button_text',
79 [
80 'label' => __('Button Text', 'essential-addons-for-elementor-lite'),
81 'type' => Controls_Manager::TEXT,
82 'dynamic' => [
83 'active' => true,
84 ],
85 'label_block' => true,
86 'default' => 'Click Me!',
87 'placeholder' => __('Enter button text', 'essential-addons-for-elementor-lite'),
88 'title' => __('Enter button text here', 'essential-addons-for-elementor-lite'),
89 ]
90 );
91
92 $this->add_control(
93 'creative_button_secondary_text',
94 [
95 'label' => __('Button Secondary Text', 'essential-addons-for-elementor-lite'),
96 'type' => Controls_Manager::TEXT,
97 'dynamic' => [
98 'active' => true,
99 ],
100 'label_block' => true,
101 'default' => 'Go!',
102 'placeholder' => __('Enter button secondary text', 'essential-addons-for-elementor-lite'),
103 'title' => __('Enter button secondary text here', 'essential-addons-for-elementor-lite'),
104 ]
105 );
106
107 $this->add_control(
108 'creative_button_link_url',
109 [
110 'label' => esc_html__('Link URL', 'essential-addons-for-elementor-lite'),
111 'type' => Controls_Manager::URL,
112 'dynamic' => [
113 'active' => true,
114 'categories' => [
115 TagsModule::POST_META_CATEGORY,
116 TagsModule::URL_CATEGORY,
117 ],
118 ],
119 'label_block' => true,
120 'default' => [
121 'url' => '#',
122 'is_external' => '',
123 ],
124 'show_external' => true,
125 ]
126 );
127
128 $this->add_control(
129 'eael_creative_button_icon_new',
130 [
131 'label' => esc_html__('Icon', 'essential-addons-for-elementor-lite'),
132 'type' => Controls_Manager::ICONS,
133 'fa4compatibility' => 'eael_creative_button_icon',
134 'condition' => [
135 'creative_button_effect!' => ['eael-creative-button--tamaya'],
136 ],
137 ]
138 );
139
140 $this->add_control(
141 'eael_creative_button_icon_alignment',
142 [
143 'label' => esc_html__('Icon Position', 'essential-addons-for-elementor-lite'),
144 'type' => Controls_Manager::SELECT,
145 'default' => 'left',
146 'options' => [
147 'left' => esc_html__('Before', 'essential-addons-for-elementor-lite'),
148 'right' => esc_html__('After', 'essential-addons-for-elementor-lite'),
149 ],
150 'condition' => [
151 'eael_creative_button_icon_new!' => '',
152 'creative_button_effect!' => ['eael-creative-button--tamaya'],
153 ],
154 ]
155 );
156
157 $this->add_responsive_control(
158 'eael_creative_button_icon_indent',
159 [
160 'label' => esc_html__('Icon Spacing', 'essential-addons-for-elementor-lite'),
161 'type' => Controls_Manager::SLIDER,
162 'range' => [
163 'px' => [
164 'max' => 60,
165 ],
166 ],
167 'condition' => [
168 'eael_creative_button_icon_new!' => '',
169 'creative_button_effect!' => ['eael-creative-button--tamaya'],
170 ],
171 'selectors' => [
172 '{{WRAPPER}} .eael-creative-button-icon-right' => 'margin-left: {{SIZE}}px;',
173 '{{WRAPPER}} .eael-creative-button-icon-left' => 'margin-right: {{SIZE}}px;',
174 '{{WRAPPER}} .eael-creative-button--shikoba i' => 'left: {{SIZE}}%;',
175 ],
176 ]
177 );
178
179 $this->end_controls_section();
180 } else {
181 do_action('eael_creative_button_pro_controls', $this);
182 }
183
184 if ( !apply_filters( 'eael/pro_enabled', false ) ) {
185 $this->start_controls_section(
186 'eael_section_pro',
187 [
188 'label' => __('Go Premium for More Features', 'essential-addons-for-elementor-lite'),
189 ]
190 );
191
192 $this->add_control(
193 'eael_control_get_pro',
194 [
195 'label' => __('Unlock more possibilities', 'essential-addons-for-elementor-lite'),
196 'type' => Controls_Manager::CHOOSE,
197 'options' => [
198 '1' => [
199 'title' => '',
200 'icon' => 'fa fa-unlock-alt',
201 ],
202 ],
203 'default' => '1',
204 'description' => '<span class="pro-feature"> Get the <a href="https://wpdeveloper.com/upgrade/ea-pro" target="_blank">Pro version</a> for more stunning elements and customization options.</span>',
205 ]
206 );
207
208 $this->end_controls_section();
209 }
210
211 // Style Controls
212 $this->start_controls_section(
213 'eael_section_creative_button_settings',
214 [
215 'label' => esc_html__('Button Effects &amp; Styles', 'essential-addons-for-elementor-lite'),
216 'tab' => Controls_Manager::TAB_STYLE,
217 ]
218 );
219 if (!apply_filters('eael/pro_enabled', false)) {
220 $this->add_control(
221 'creative_button_effect',
222 [
223 'label' => esc_html__('Set Button Effect', 'essential-addons-for-elementor-lite'),
224 'type' => Controls_Manager::SELECT,
225 'default' => 'eael-creative-button--default',
226 'options' => [
227 'eael-creative-button--default' => esc_html__('Default', 'essential-addons-for-elementor-lite'),
228 'eael-creative-button--winona' => esc_html__('Winona', 'essential-addons-for-elementor-lite'),
229 'eael-creative-button--ujarak' => esc_html__('Ujarak', 'essential-addons-for-elementor-lite'),
230 'eael-creative-button--wayra' => esc_html__('Wayra', 'essential-addons-for-elementor-lite'),
231 'eael-creative-button--tamaya' => esc_html__('Tamaya', 'essential-addons-for-elementor-lite'),
232 'eael-creative-button--rayen' => esc_html__('Rayen', 'essential-addons-for-elementor-lite'),
233 'eael-creative-button--pipaluk' => esc_html__('Pipaluk (Pro)', 'essential-addons-for-elementor-lite'),
234 'eael-creative-button--moema' => esc_html__('Moema (Pro)', 'essential-addons-for-elementor-lite'),
235 'eael-creative-button--wave' => esc_html__('Wave (Pro)', 'essential-addons-for-elementor-lite'),
236 'eael-creative-button--aylen' => esc_html__('Aylen (Pro)', 'essential-addons-for-elementor-lite'),
237 'eael-creative-button--saqui' => esc_html__('Saqui (Pro)', 'essential-addons-for-elementor-lite'),
238 'eael-creative-button--wapasha' => esc_html__('Wapasha (Pro)', 'essential-addons-for-elementor-lite'),
239 'eael-creative-button--nuka' => esc_html__('Nuka (Pro)', 'essential-addons-for-elementor-lite'),
240 'eael-creative-button--antiman' => esc_html__('Antiman (Pro)', 'essential-addons-for-elementor-lite'),
241 'eael-creative-button--quidel' => esc_html__('Quidel (Pro)', 'essential-addons-for-elementor-lite'),
242 'eael-creative-button--shikoba' => esc_html__('Shikoba (Pro)', 'essential-addons-for-elementor-lite'),
243 ],
244 'description' => '10 more effects on <a href="https://wpdeveloper.com/in/upgrade-essential-addons-elementor">Pro version</a>',
245 ]
246 );
247 $this->add_control(
248 'use_gradient_background',
249 [
250 'label' => __('Use Gradient Background', 'essential-addons-for-elementor-lite'),
251 'type' => Controls_Manager::SWITCHER,
252 'label_on' => __('Show', 'essential-addons-for-elementor-lite'),
253 'label_off' => __('Hide', 'essential-addons-for-elementor-lite'),
254 'return_value' => 'yes',
255 'default' => '',
256 ]
257 );
258 $this->start_controls_tabs('eael_creative_button_tabs');
259
260 $this->start_controls_tab('normal', ['label' => esc_html__('Normal', 'essential-addons-for-elementor-lite')]);
261
262 $this->add_control('eael_creative_button_icon_color',
263 [
264 'label' => esc_html__('Icon Color', 'essential-addons-elementor'),
265 'type' => Controls_Manager::COLOR,
266 'default' => '#ffffff',
267 'selectors' => [
268 '{{WRAPPER}} .eael-creative-button i' => 'color: {{VALUE}};',
269 '{{WRAPPER}} .eael-creative-button .creative-button-inner svg' => 'fill: {{VALUE}};',
270 ],
271 ]
272 );
273
274 $this->add_control(
275 'eael_creative_button_text_color',
276 [
277 'label' => esc_html__('Text Color', 'essential-addons-for-elementor-lite'),
278 'type' => Controls_Manager::COLOR,
279 'default' => '#ffffff',
280 'selectors' => [
281 '{{WRAPPER}} .eael-creative-button' => 'color: {{VALUE}};',
282 '{{WRAPPER}} .eael-creative-button svg' => 'fill: {{VALUE}};',
283 '{{WRAPPER}} .eael-creative-button.eael-creative-button--tamaya::before' => 'color: {{VALUE}};',
284 '{{WRAPPER}} .eael-creative-button.eael-creative-button--tamaya::after' => 'color: {{VALUE}};',
285 ],
286 ]
287 );
288 $this->add_control(
289 'eael_creative_button_background_color',
290 [
291 'label' => esc_html__('Background Color', 'essential-addons-for-elementor-lite'),
292 'type' => Controls_Manager::COLOR,
293 'default' => '#f54',
294 'selectors' => [
295 '{{WRAPPER}} .eael-creative-button' => 'background-color: {{VALUE}};',
296 '{{WRAPPER}} .eael-creative-button.eael-creative-button--ujarak:hover' => 'background-color: {{VALUE}};',
297 '{{WRAPPER}} .eael-creative-button.eael-creative-button--wayra:hover' => 'background-color: {{VALUE}};',
298 '{{WRAPPER}} .eael-creative-button.eael-creative-button--tamaya::before' => 'background-color: {{VALUE}};',
299 '{{WRAPPER}} .eael-creative-button.eael-creative-button--tamaya::after' => 'background-color: {{VALUE}};',
300 ],
301 'condition' => [
302 'use_gradient_background' => '',
303 ],
304 ]
305 );
306
307 $this->add_group_control(
308 Group_Control_Background::get_type(),
309 [
310 'name' => 'eael_creative_button_gradient_background',
311 'types' => ['gradient', 'classic'],
312 'selector' => '
313 {{WRAPPER}} .eael-creative-button,
314 {{WRAPPER}} .eael-creative-button.eael-creative-button--ujarak:hover,
315 {{WRAPPER}} .eael-creative-button.eael-creative-button--wayra:hover,
316 {{WRAPPER}} .eael-creative-button.eael-creative-button--tamaya::before,
317 {{WRAPPER}} .eael-creative-button.eael-creative-button--tamaya::after
318 ',
319 'condition' => [
320 'use_gradient_background' => 'yes',
321 ],
322 ]
323 );
324
325 $this->add_group_control(
326 Group_Control_Border::get_type(),
327 [
328 'name' => 'eael_creative_button_border',
329 'selector' => '{{WRAPPER}} .eael-creative-button',
330 ]
331 );
332
333 $this->add_control(
334 'eael_creative_button_border_radius',
335 [
336 'label' => esc_html__('Border Radius', 'essential-addons-for-elementor-lite'),
337 'type' => Controls_Manager::SLIDER,
338 'range' => [
339 'px' => [
340 'max' => 100,
341 ],
342 ],
343 'selectors' => [
344 '{{WRAPPER}} .eael-creative-button' => 'border-radius: {{SIZE}}px;',
345 '{{WRAPPER}} .eael-creative-button::before' => 'border-radius: {{SIZE}}px;',
346 '{{WRAPPER}} .eael-creative-button::after' => 'border-radius: {{SIZE}}px;',
347 ],
348 ]
349 );
350
351 $this->end_controls_tab();
352
353 $this->start_controls_tab('eael_creative_button_hover', ['label' => esc_html__('Hover', 'essential-addons-for-elementor-lite')]);
354
355 $this->add_control('eael_creative_button_hover_icon_color',
356 [
357 'label' => esc_html__('Icon Color', 'essential-addons-elementor'),
358 'type' => Controls_Manager::COLOR,
359 'default' => '#ffffff',
360 'selectors' => [
361 '{{WRAPPER}} .eael-creative-button:hover i' => 'color: {{VALUE}};',
362 '{{WRAPPER}} .eael-creative-button:hover .creative-button-inner svg' => 'fill: {{VALUE}};',
363 ],
364 ]
365 );
366
367 $this->add_control(
368 'eael_creative_button_hover_text_color',
369 [
370 'label' => esc_html__('Text Color', 'essential-addons-for-elementor-lite'),
371 'type' => Controls_Manager::COLOR,
372 'default' => '#ffffff',
373 'selectors' => [
374 '{{WRAPPER}} .eael-creative-button:hover .cretive-button-text' => 'color: {{VALUE}};',
375 '{{WRAPPER}} .eael-creative-button.eael-creative-button--winona::after' => 'color: {{VALUE}};',
376 '{{WRAPPER}} .eael-creative-button.eael-creative-button--rayen:hover::before' => 'color: {{VALUE}};',
377 ],
378 ]
379 );
380
381 $this->add_control(
382 'eael_creative_button_hover_background_color',
383 [
384 'label' => esc_html__('Background Color', 'essential-addons-for-elementor-lite'),
385 'type' => Controls_Manager::COLOR,
386 'default' => '#f54',
387 'selectors' => [
388 '{{WRAPPER}} .eael-creative-button:hover' => 'background-color: {{VALUE}};',
389 '{{WRAPPER}} .eael-creative-button.eael-creative-button--ujarak::before' => 'background-color: {{VALUE}};',
390 '{{WRAPPER}} .eael-creative-button.eael-creative-button--wayra:hover::before' => 'background-color: {{VALUE}};',
391 '{{WRAPPER}} .eael-creative-button.eael-creative-button--tamaya:hover' => 'background-color: {{VALUE}};',
392 '{{WRAPPER}} .eael-creative-button.eael-creative-button--rayen::before' => 'background-color: {{VALUE}};',
393 '{{WRAPPER}} .eael-creative-button.eael-creative-button--rayen:hover::before' => 'background-color: {{VALUE}};',
394 ],
395 'condition' => [
396 'use_gradient_background' => '',
397 ],
398 ]
399 );
400
401 $this->add_group_control(
402 Group_Control_Background::get_type(),
403 [
404 'name' => 'eael_creative_button_hover_gradient_background',
405 'types' => ['gradient', 'classic'],
406 'selector' => '
407 {{WRAPPER}} .eael-creative-button:hover,
408 {{WRAPPER}} .eael-creative-button.eael-creative-button--ujarak::before,
409 {{WRAPPER}} .eael-creative-button.eael-creative-button--wayra:hover::before,
410 {{WRAPPER}} .eael-creative-button.eael-creative-button--tamaya:hover,
411 {{WRAPPER}} .eael-creative-button.eael-creative-button--rayen::before
412 {{WRAPPER}} .eael-creative-button.eael-creative-button--rayen:hover::before
413 ',
414 'condition' => [
415 'use_gradient_background' => 'yes',
416 ],
417 ]
418 );
419
420 $this->add_control(
421 'eael_creative_button_hover_border_color',
422 [
423 'label' => esc_html__('Border Color', 'essential-addons-for-elementor-lite'),
424 'type' => Controls_Manager::COLOR,
425 'default' => '',
426 'selectors' => [
427 '{{WRAPPER}} .eael-creative-button:hover' => 'border-color: {{VALUE}};',
428 '{{WRAPPER}} .eael-creative-button.eael-creative-button--wapasha::before' => 'border-color: {{VALUE}};',
429 '{{WRAPPER}} .eael-creative-button.eael-creative-button--antiman::before' => 'border-color: {{VALUE}};',
430 '{{WRAPPER}} .eael-creative-button.eael-creative-button--pipaluk::before' => 'border-color: {{VALUE}};',
431 '{{WRAPPER}} .eael-creative-button.eael-creative-button--quidel::before' => 'background-color: {{VALUE}};',
432 ],
433 ]
434 );
435
436 $this->end_controls_tab();
437
438 $this->end_controls_tabs();
439
440 $this->add_responsive_control(
441 'eael_creative_button_alignment',
442 [
443 'label' => esc_html__('Button Alignment', 'essential-addons-for-elementor-lite'),
444 'type' => Controls_Manager::CHOOSE,
445 'label_block' => true,
446 'options' => [
447 'flex-start' => [
448 'title' => esc_html__('Left', 'essential-addons-for-elementor-lite'),
449 'icon' => 'eicon-text-align-left',
450 ],
451 'center' => [
452 'title' => esc_html__('Center', 'essential-addons-for-elementor-lite'),
453 'icon' => 'eicon-text-align-center',
454 ],
455 'flex-end' => [
456 'title' => esc_html__('Right', 'essential-addons-for-elementor-lite'),
457 'icon' => 'eicon-text-align-right',
458 ],
459 ],
460 'default' => '',
461 'selectors' => [
462 '{{WRAPPER}} .eael-creative-button-wrapper' => 'justify-content: {{VALUE}};',
463 ],
464 ]
465 );
466
467 $this->add_responsive_control(
468 'eael_creative_button_width',
469 [
470 'label' => esc_html__('Width', 'essential-addons-for-elementor-lite'),
471 'type' => Controls_Manager::SLIDER,
472 'size_units' => ['px', '%'],
473 'range' => [
474 'px' => [
475 'min' => 0,
476 'max' => 500,
477 'step' => 1,
478 ],
479 '%' => [
480 'min' => 0,
481 'max' => 100,
482 ],
483 ],
484 'selectors' => [
485 '{{WRAPPER}} .eael-creative-button' => 'width: {{SIZE}}{{UNIT}};',
486 ],
487 ]
488 );
489
490 $this->add_group_control(
491 Group_Control_Typography::get_type(),
492 [
493 'name' => 'eael_creative_button_typography',
494 'scheme' => Typography::TYPOGRAPHY_1,
495 'selector' => '{{WRAPPER}} .eael-creative-button .cretive-button-text, {{WRAPPER}} .eael-creative-button--winona::after, {{WRAPPER}} .eael-creative-button--rayen::before, {{WRAPPER}} .eael-creative-button--tamaya::after, {{WRAPPER}} .eael-creative-button--tamaya::before',
496 ]
497 );
498
499 $this->add_responsive_control(
500 'eael_creative_button_icon_size',
501 [
502 'label' => esc_html__('Icon Size', 'essential-addons-for-elementor-lite'),
503 'type' => Controls_Manager::SLIDER,
504 'size_units' => ['px', '%'],
505 'default' => [
506 'size' => 30,
507 'unit' => 'px',
508 ],
509 'range' => [
510 'px' => [
511 'min' => 0,
512 'max' => 500,
513 'step' => 1,
514 ],
515 '%' => [
516 'min' => 0,
517 'max' => 100,
518 ],
519 ],
520 'selectors' => [
521 '{{WRAPPER}} .eael-creative-button i' => 'font-size: {{SIZE}}{{UNIT}};',
522 '{{WRAPPER}} .eael-creative-button svg' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};',
523 ],
524 ]
525 );
526
527 $this->add_responsive_control(
528 'eael_creative_button_padding',
529 [
530 'label' => esc_html__('Button Padding', 'essential-addons-for-elementor-lite'),
531 'type' => Controls_Manager::DIMENSIONS,
532 'size_units' => ['px', 'em', '%'],
533 'selectors' => [
534 '{{WRAPPER}} .eael-creative-button' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
535 '{{WRAPPER}} .eael-creative-button.eael-creative-button--winona::after' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
536 '{{WRAPPER}} .eael-creative-button.eael-creative-button--winona > .creative-button-inner' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
537 '{{WRAPPER}} .eael-creative-button.eael-creative-button--tamaya::before' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
538 '{{WRAPPER}} .eael-creative-button.eael-creative-button--rayen::before' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
539 '{{WRAPPER}} .eael-creative-button.eael-creative-button--rayen > .creative-button-inner' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
540 '{{WRAPPER}} .eael-creative-button.eael-creative-button--saqui::after' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
541 ],
542 ]
543 );
544 } else {
545 do_action('eael_creative_button_style_pro_controls', $this);
546 }
547
548 $this->add_group_control(
549 Group_Control_Box_Shadow::get_type(),
550 [
551 'name' => 'button_box_shadow',
552 'selector' => '{{WRAPPER}} .eael-creative-button',
553 ]
554 );
555
556 $this->end_controls_section();
557 }
558
559 protected function render()
560 {
561 $settings = $this->get_settings_for_display();
562 $icon_migrated = isset($settings['__fa4_migrated']['eael_creative_button_icon_new']);
563 $icon_is_new = empty($settings['eael_creative_button_icon']);
564
565 $this->add_render_attribute('eael_creative_button', [
566 'class' => ['eael-creative-button', esc_attr($settings['creative_button_effect'])],
567 ]);
568
569 if ( ! empty( $settings['creative_button_link_url']['url'] ) ) {
570 $this->add_link_attributes( 'eael_creative_button', $settings['creative_button_link_url'] );
571 }
572
573 if ($settings['creative_button_link_url']['is_external']) {
574 $this->add_render_attribute('eael_creative_button', 'target', '_blank');
575 }
576
577 if ($settings['creative_button_link_url']['nofollow']) {
578 $this->add_render_attribute('eael_creative_button', 'rel', 'nofollow');
579 }
580
581 $this->add_render_attribute('eael_creative_button', 'data-text', esc_attr($settings['creative_button_secondary_text']));
582 ?>
583 <div class="eael-creative-button-wrapper">
584
585 <a <?php echo $this->get_render_attribute_string('eael_creative_button'); ?>>
586
587 <div class="creative-button-inner">
588
589 <?php if ($settings['creative_button_effect'] !== 'eael-creative-button--tamaya' && $settings['eael_creative_button_icon_alignment'] == 'left') : ?>
590 <?php if ($icon_migrated || $icon_is_new) {
591 echo '<span class="eael-creative-button-icon-left">';
592 Icons_Manager::render_icon( $settings['eael_creative_button_icon_new'], [ 'aria-hidden' => 'true' ] );
593 echo '</span>';
594 } else { ?>
595 <i class="<?php echo esc_attr($settings['eael_creative_button_icon']); ?> eael-creative-button-icon-left" aria-hidden="true"></i>
596 <?php } ?>
597 <?php endif; ?>
598
599 <span class="cretive-button-text"><?php echo Helper::eael_wp_kses($settings['creative_button_text']); ?></span>
600
601 <?php if ($settings['creative_button_effect'] !== 'eael-creative-button--tamaya' && $settings['eael_creative_button_icon_alignment'] == 'right') : ?>
602 <?php if ($icon_migrated || $icon_is_new) {
603 echo '<span class="eael-creative-button-icon-right">';
604 Icons_Manager::render_icon( $settings['eael_creative_button_icon_new'], [ 'aria-hidden' => 'true' ] );
605 echo '</span>';
606 } else { ?>
607 <i class="<?php echo esc_attr($settings['eael_creative_button_icon']); ?> eael-creative-button-icon-right" aria-hidden="true"></i>
608 <?php } ?>
609 <?php endif; ?>
610 </div>
611 </a>
612 </div>
613 <?php
614
615 }
616 }
617