PluginProbe
Easy Elements for Elementor – Addons & Website Templates / 1.4.4
Easy Elements for Elementor – Addons & Website Templates v1.4.4
1.5.3 1.5.2 1.5.1 1.5.0 1.4.9 1.4.6 1.4.7 1.4.8 1.4.5 1.4.4 1.4.3 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 All 47 releases
easy-elements / widgets / heading / heading.php

heading.php in Easy Elements for Elementor – Addons & Website Templates 1.4.4, at widgets/heading/heading.php

1,478 lines 46.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace Easyel\EasyElements\Widgets;
3 use Elementor\Controls_Manager;
4 use Elementor\Group_Control_Typography;
5 use Elementor\Widget_Base;
6 use Elementor\Group_Control_Background;
7
8 if ( ! defined( 'ABSPATH' ) ) {
9 exit;
10 }
11
12 class Easyel_Heading_Widget extends \Elementor\Widget_Base {
13
14 public function get_name() {
15 return 'eel-heading';
16 }
17
18 public function get_title() {
19 return __( 'Heading', 'easy-elements' );
20 }
21
22 public function get_icon() {
23 return 'easyicon easyelIcon-heading';
24 }
25
26 public function get_categories() {
27 return [ 'easyelements_category' ];
28 }
29 public function get_keywords() {
30 return [ 'heading', 'title', 'link', 'click', 'text' ];
31 }
32
33 public function get_style_depends() {
34 return [
35 'eel-heading',
36 ];
37 }
38
39
40 protected function register_controls() {
41 $this->start_controls_section(
42 'content_section',
43 [
44 'label' => esc_html__('Heading Settings', 'easy-elements'),
45 'tab' => Controls_Manager::TAB_CONTENT,
46 ]
47 );
48
49 $this->add_control(
50 'title',
51 [
52 'label' => esc_html__('Heading Text', 'easy-elements'),
53 'type' => Controls_Manager::TEXTAREA,
54 'default' => esc_html__('Heading Here', 'easy-elements'),
55 'label_block' => true,
56 'description' => esc_html__('You can highlight part of the text using double curly brackets. Example: Heading {{Here}} will highlight "Here".', 'easy-elements'),
57 ]
58 );
59
60 $this->add_control(
61 'show_border_title',
62 [
63 'label' => esc_html__( 'Show Border', 'easy-elements' ),
64 'type' => \Elementor\Controls_Manager::SWITCHER,
65 'label_on' => esc_html__( 'Show', 'easy-elements' ),
66 'label_off' => esc_html__( 'Hide', 'easy-elements' ),
67 'return_value' => 'yes',
68 'default' => '',
69 ]
70 );
71
72 $this->add_control(
73 'show_gradient_title',
74 [
75 'label' => esc_html__( 'Gradient Text', 'easy-elements' ),
76 'type' => \Elementor\Controls_Manager::SWITCHER,
77 'label_on' => esc_html__( 'Show', 'easy-elements' ),
78 'label_off' => esc_html__( 'Hide', 'easy-elements' ),
79 'return_value' => 'yes',
80 'default' => '',
81 ]
82 );
83
84 $this->add_control(
85 'border_position',
86 [
87 'label' => esc_html__( 'Border Position', 'easy-elements' ),
88 'type' => \Elementor\Controls_Manager::SELECT,
89 'default' => 'eel_title_start',
90 'options' => [
91 'eel_title_start' => esc_html__( 'Only Start Title', 'easy-elements' ),
92 'eel_title_end' => esc_html__( 'Only Title End', 'easy-elements' ),
93 'eel_full_title_start' => esc_html__( 'Full Title Part Start', 'easy-elements' ),
94 'eel_full_title_end' => esc_html__( 'Full Title Part End', 'easy-elements' ),
95 ],
96 'condition' => [
97 'show_border_title' => 'yes',
98 ],
99 ]
100 );
101
102
103 $this->add_control(
104 'border_color',
105 [
106 'label' => esc_html__('Border Color', 'easy-elements'),
107 'type' => Controls_Manager::COLOR,
108 'selectors' => [
109 '{{WRAPPER}} .eel_full_title_end, {{WRAPPER}} .eel_title_end .e-e-title, {{WRAPPER}} .eel_full_title_start, {{WRAPPER}} .eel_title_start .e-e-title' => 'border-color: {{VALUE}};',
110 ],
111 'condition' => [
112 'show_border_title' => 'yes',
113 ],
114 ]
115 );
116
117 $this->add_responsive_control(
118 'title_border_padding',
119 [
120 'label' => esc_html__( 'Padding', 'easy-elements' ),
121 'type' => \Elementor\Controls_Manager::DIMENSIONS,
122 'size_units' => [ 'px', '%', 'em' ],
123 'selectors' => [
124 '{{WRAPPER}} .eel_full_title_end, {{WRAPPER}} .eel_title_end .e-e-title, {{WRAPPER}} .eel_full_title_start, {{WRAPPER}} .eel_title_start .e-e-title' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
125 ],
126 'condition' => [
127 'show_border_title' => 'yes',
128 ],
129 ]
130 );
131
132
133 $this->add_control(
134 'link',
135 [
136 'label' => __( 'Link', 'easy-elements' ),
137 'type' => \Elementor\Controls_Manager::URL,
138 'placeholder' => 'https://your-link.com',
139 'default' => [
140 'url' => '',
141 'is_external' => false,
142 'nofollow' => false,
143 ],
144 'show_external' => true,
145 'description' => esc_html__( 'Set a URL to make the heading clickable. Supports opening in a new tab and nofollow attribute.', 'easy-elements' ),
146 ]
147 );
148
149 $this->add_control(
150 'title_tag',
151 [
152 'label' => esc_html__('HTML Tag', 'easy-elements'),
153 'type' => Controls_Manager::SELECT,
154 'default' => 'h2',
155 'description' => esc_html__('Choose the HTML tag for SEO. Use H1 once per page only.', 'easy-elements'),
156 'options' => [
157 'h1' => 'H1',
158 'h2' => 'H2',
159 'h3' => 'H3',
160 'h4' => 'H4',
161 'h5' => 'H5',
162 'h6' => 'H6',
163 'div' => 'div',
164 ],
165 ]
166 );
167
168 $this->add_control(
169 'description',
170 [
171 'label' => esc_html__('Description', 'easy-elements'),
172 'type' => Controls_Manager::TEXTAREA,
173 'label_block' => true,
174 ]
175 );
176
177
178 $this->add_responsive_control(
179 'align',
180 [
181 'label' => esc_html__('Alignment', 'easy-elements'),
182 'type' => Controls_Manager::CHOOSE,
183 'options' => [
184 'left' => [
185 'title' => esc_html__('Left', 'easy-elements'),
186 'icon' => 'eicon-text-align-left',
187 ],
188 'center' => [
189 'title' => esc_html__('Center', 'easy-elements'),
190 'icon' => 'eicon-text-align-center',
191 ],
192 'right' => [
193 'title' => esc_html__('Right', 'easy-elements'),
194 'icon' => 'eicon-text-align-right',
195 ],
196 'justify' => [
197 'title' => esc_html__('Justify', 'easy-elements'),
198 'icon' => 'eicon-text-align-justify',
199 ],
200 ],
201 'toggle' => true,
202 'selectors' => [
203 '{{WRAPPER}} .e-e-heading' => 'text-align: {{VALUE}}',
204 '{{WRAPPER}} .image-heading' => 'justify-content: {{VALUE}}',
205 ],
206 ]
207 );
208
209 $this->end_controls_section();
210
211 $this->start_controls_section(
212 'sub_heading_section',
213 [
214 'label' => esc_html__('Sub Heading Settings', 'easy-elements'),
215 'tab' => Controls_Manager::TAB_CONTENT,
216 ]
217 );
218
219 $this->add_control(
220 'sub_title',
221 [
222 'label' => esc_html__( 'Sub Heading', 'easy-elements' ),
223 'type' => \Elementor\Controls_Manager::TEXTAREA,
224 'label_block' => true,
225 ]
226 );
227
228 $this->add_control(
229 'show_gradient_border',
230 [
231 'label' => esc_html__( 'Show Gradient Border', 'easy-elements' ),
232 'type' => \Elementor\Controls_Manager::SWITCHER,
233 'label_on' => esc_html__( 'Show', 'easy-elements' ),
234 'label_off' => esc_html__( 'Hide', 'easy-elements' ),
235 'return_value' => 'yes',
236 'default' => '',
237 ]
238 );
239
240 $this->add_control(
241 'gradient_color_1',
242 [
243 'label' => esc_html__( 'Gradient Color 1', 'easy-elements' ),
244 'type' => \Elementor\Controls_Manager::COLOR,
245 'default' => 'rgba(0, 0, 0, 0.15)',
246 'selectors' => [
247 '{{WRAPPER}} .easy_gradiant_border::before' => '--grad-color-1: {{VALUE}};',
248 ],
249 'condition' => [
250 'show_gradient_border' => 'yes',
251 ],
252 ]
253 );
254
255 $this->add_control(
256 'gradient_color_2',
257 [
258 'label' => esc_html__( 'Gradient Color 2', 'easy-elements' ),
259 'type' => \Elementor\Controls_Manager::COLOR,
260 'default' => 'rgba(0, 0, 0, 0.30)',
261 'selectors' => [
262 '{{WRAPPER}} .easy_gradiant_border::before' => '--grad-color-2: {{VALUE}};',
263 ],
264 'condition' => [
265 'show_gradient_border' => 'yes',
266 ],
267 ]
268 );
269
270 $this->add_control(
271 'gradient_color_3',
272 [
273 'label' => esc_html__( 'Gradient Color 3', 'easy-elements' ),
274 'type' => \Elementor\Controls_Manager::COLOR,
275 'default' => 'rgba(0, 0, 0, 0.50)',
276 'selectors' => [
277 '{{WRAPPER}} .easy_gradiant_border::before' => '--grad-color-3: {{VALUE}};',
278 ],
279 'condition' => [
280 'show_gradient_border' => 'yes',
281 ],
282 ]
283 );
284
285
286 $this->add_responsive_control(
287 'sub_gradient_border_padding',
288 [
289 'label' => __('Gradient Border Padding', 'easy-elements'),
290 'type' => \Elementor\Controls_Manager::DIMENSIONS,
291 'size_units' => ['px', '%', 'em'],
292 'selectors' => [
293 '{{WRAPPER}} .easy_gradiant_border' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
294 ],
295 'condition' => [
296 'show_gradient_border' => 'yes',
297 ],
298 ]
299 );
300
301 $this->add_responsive_control(
302 'gradient_border_radius',
303 [
304 'label' => esc_html__( 'Border Radius', 'easy-elements' ),
305 'type' => \Elementor\Controls_Manager::SLIDER,
306 'size_units' => [ 'px', '%' ],
307 'range' => [
308 'px' => [
309 'min' => 0,
310 'max' => 200,
311 ],
312 '%' => [
313 'min' => 0,
314 'max' => 100,
315 ],
316 ],
317 'default' => [
318 'unit' => 'px',
319 'size' => 40,
320 ],
321 'selectors' => [
322 '{{WRAPPER}} .easy_gradiant_border::before' => '--grad-border-radius: {{SIZE}}{{UNIT}};',
323 ],
324 'condition' => [
325 'show_gradient_border' => 'yes',
326 ],
327 ]
328 );
329
330
331 $this->add_control(
332 'sub_heading_type',
333 [
334 'label' => esc_html__( 'Sub Heading Type', 'easy-elements' ),
335 'type' => \Elementor\Controls_Manager::CHOOSE,
336 'options' => [
337 'none' => [
338 'title' => esc_html__( 'None', 'easy-elements' ),
339 'icon' => 'eicon-ban',
340 ],
341 'icon' => [
342 'title' => esc_html__( 'Icon', 'easy-elements' ),
343 'icon' => 'eicon-star',
344 ],
345 'image' => [
346 'title' => esc_html__( 'Image', 'easy-elements' ),
347 'icon' => 'eicon-image-bold',
348 ],
349 ],
350 'default' => 'none',
351 'toggle' => false,
352 ]
353 );
354
355 $this->add_control(
356 'sub_heading_icon',
357 [
358 'label' => esc_html__( 'Select Icon', 'easy-elements' ),
359 'type' => \Elementor\Controls_Manager::ICONS,
360 'default' => [
361 'value' => 'fas fa-heart',
362 'library' => 'fa-solid',
363 ],
364 'condition' => [
365 'sub_heading_type' => 'icon',
366 ],
367 ]
368 );
369
370 $this->add_control(
371 'sub_heading_image',
372 [
373 'label' => esc_html__( 'Upload Image', 'easy-elements' ),
374 'type' => \Elementor\Controls_Manager::MEDIA,
375 'default' => [
376 'url' => \Elementor\Utils::get_placeholder_image_src(),
377 ],
378 'condition' => [
379 'sub_heading_type' => 'image',
380 ],
381 ]
382 );
383
384 $this->add_control(
385 'icon_color',
386 [
387 'label' => esc_html__('Icon Color', 'easy-elements'),
388 'type' => Controls_Manager::COLOR,
389 'selectors' => [
390 '{{WRAPPER}} .eel-sub-heading i, {{WRAPPER}} .eel-sub-heading svg' => 'color: {{VALUE}}; fill: {{VALUE}};',
391 ],
392 'condition' => [
393 'sub_heading_type' => ['icon'],
394 ],
395 ]
396 );
397
398 $this->add_responsive_control(
399 'sub_heading_icon_margin',
400 [
401 'label' => esc_html__( 'Icon Spacing', 'easy-elements' ),
402 'type' => \Elementor\Controls_Manager::DIMENSIONS,
403 'size_units' => [ 'px', '%', 'em' ],
404 'selectors' => [
405 '{{WRAPPER}} .eel-sub-heading span' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
406 ],
407 'condition' => [
408 'sub_heading_type' => ['image', 'icon'],
409 ],
410 ]
411 );
412
413 $this->add_control(
414 'icon_direction',
415 [
416 'label' => esc_html__( 'Direction', 'easy-elements' ),
417 'type' => \Elementor\Controls_Manager::CHOOSE,
418 'default' => 'top',
419 'options' => [
420 'left' => [
421 'title' => esc_html__( 'Left', 'easy-elements' ),
422 'icon' => 'eicon-h-align-left',
423 ],
424 'top' => [
425 'title' => esc_html__( 'Top', 'easy-elements' ),
426 'icon' => 'eicon-v-align-top',
427 ],
428 'right' => [
429 'title' => esc_html__( 'Right', 'easy-elements' ),
430 'icon' => 'eicon-h-align-right',
431 ],
432 ],
433 'toggle' => false,
434 ]
435 );
436 $this->end_controls_section();
437
438 $this->start_controls_section(
439 'separator_section',
440 [
441 'label' => esc_html__('Separator Settings', 'easy-elements'),
442 'tab' => Controls_Manager::TAB_CONTENT,
443 ]
444 );
445
446 $this->add_control(
447 'separator_',
448 [
449 'label' => __( 'Separator Type', 'easy-elements' ),
450 'type' => \Elementor\Controls_Manager::SELECT,
451 'options' => [
452 'none' => __( 'None', 'easy-elements' ),
453 'dotted' => __( 'Dotted', 'easy-elements' ),
454 'solid' => __( 'Solid', 'easy-elements' ),
455 'icon' => __( 'Icon', 'easy-elements' ),
456 'image' => __( 'Image', 'easy-elements' ),
457 ],
458 'default' => 'none',
459 'description' => esc_html__( 'Pick a separator style: solid bar, dotted dots, a font icon, or your own image.', 'easy-elements' ),
460 ]
461 );
462
463 // Solid / Dotted: color + size
464 $this->add_control(
465 'solid_color',
466 [
467 'label' => esc_html__('Separator Color', 'easy-elements'),
468 'type' => \Elementor\Controls_Manager::COLOR,
469 'selectors' => [
470 '{{WRAPPER}} .eel--separator-icon.dotted::before, {{WRAPPER}} .eel--separator-icon' => 'color: {{VALUE}}; background-color: {{VALUE}};',
471 ],
472 'condition' => [
473 'separator_' => ['solid', 'dotted'],
474 ],
475 ]
476 );
477
478 $this->add_responsive_control(
479 'separator_bar_width',
480 [
481 'label' => esc_html__( 'Width', 'easy-elements' ),
482 'type' => \Elementor\Controls_Manager::SLIDER,
483 'size_units' => [ 'px', '%', 'em' ],
484 'range' => [
485 'px' => [ 'min' => 5, 'max' => 500 ],
486 '%' => [ 'min' => 1, 'max' => 100 ],
487 ],
488 'selectors' => [
489 '{{WRAPPER}} .eel--separator-icon' => 'width: {{SIZE}}{{UNIT}};',
490 ],
491 'condition' => [
492 'separator_' => ['solid', 'dotted'],
493 ],
494 ]
495 );
496
497 $this->add_responsive_control(
498 'separator_bar_height',
499 [
500 'label' => esc_html__( 'Height (Solid)', 'easy-elements' ),
501 'type' => \Elementor\Controls_Manager::SLIDER,
502 'size_units' => [ 'px', 'em' ],
503 'range' => [
504 'px' => [ 'min' => 1, 'max' => 50 ],
505 ],
506 'selectors' => [
507 '{{WRAPPER}} .eel--separator-icon' => 'height: {{SIZE}}{{UNIT}};',
508 ],
509 'description' => esc_html__( 'Bar thickness. Applies to the Solid type.', 'easy-elements' ),
510 'condition' => [
511 'separator_' => ['solid'],
512 ],
513 ]
514 );
515
516 // Icon: picker + color + size
517 $this->add_control(
518 'select_icon_',
519 [
520 'label' => esc_html__( 'Select/Upload Icon', 'easy-elements' ),
521 'type' => \Elementor\Controls_Manager::ICONS,
522 'default' => [
523 'value' => 'fas fa-heart',
524 'library' => 'fa-solid',
525 ],
526 'description' => esc_html__( 'You can upload an SVG image or choose a font icon.', 'easy-elements' ),
527 'condition' => [
528 'separator_' => ['icon'],
529 ],
530 ]
531 );
532
533 $this->add_control(
534 'separator_icon_color',
535 [
536 'label' => esc_html__( 'Icon Color', 'easy-elements' ),
537 'type' => \Elementor\Controls_Manager::COLOR,
538 'selectors' => [
539 '{{WRAPPER}} .eel--separator-icon-wrap i, {{WRAPPER}} .eel--separator-icon-wrap svg' => 'color: {{VALUE}}; fill: {{VALUE}};',
540 ],
541 'condition' => [
542 'separator_' => ['icon'],
543 ],
544 ]
545 );
546
547 $this->add_responsive_control(
548 'separator_icon_size',
549 [
550 'label' => esc_html__( 'Icon Size', 'easy-elements' ),
551 'type' => \Elementor\Controls_Manager::SLIDER,
552 'size_units' => [ 'px', 'em' ],
553 'range' => [
554 'px' => [ 'min' => 6, 'max' => 200 ],
555 'em' => [ 'min' => 0.5, 'max' => 10 ],
556 ],
557 'selectors' => [
558 '{{WRAPPER}} .eel--separator-icon-wrap i' => 'font-size: {{SIZE}}{{UNIT}};',
559 '{{WRAPPER}} .eel--separator-icon-wrap svg' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};',
560 ],
561 'condition' => [
562 'separator_' => ['icon'],
563 ],
564 ]
565 );
566
567 // Image: upload + size
568 $this->add_control(
569 'sep_image',
570 [
571 'label' => esc_html__( 'Upload Image', 'easy-elements' ),
572 'type' => \Elementor\Controls_Manager::MEDIA,
573 'default' => [
574 'url' => \Elementor\Utils::get_placeholder_image_src(),
575 ],
576 'condition' => [
577 'separator_' => 'image',
578 ],
579 ]
580 );
581
582 $this->add_responsive_control(
583 'separator_image_width',
584 [
585 'label' => esc_html__( 'Image Width', 'easy-elements' ),
586 'type' => \Elementor\Controls_Manager::SLIDER,
587 'size_units' => [ 'px', '%', 'em' ],
588 'range' => [
589 'px' => [ 'min' => 10, 'max' => 500 ],
590 '%' => [ 'min' => 1, 'max' => 100 ],
591 ],
592 'selectors' => [
593 '{{WRAPPER}} .eel-separator-img' => 'width: {{SIZE}}{{UNIT}}; height: auto;',
594 ],
595 'description' => esc_html__( 'Height stays auto to keep aspect ratio.', 'easy-elements' ),
596 'condition' => [
597 'separator_' => 'image',
598 ],
599 ]
600 );
601
602 // Position + Margin (apply to all types)
603 $this->add_control(
604 'separator_position',
605 [
606 'label' => esc_html__( 'Position', 'easy-elements' ),
607 'type' => \Elementor\Controls_Manager::SELECT,
608 'default' => 'below',
609 'options' => [
610 'top' => esc_html__( 'Top of Widget', 'easy-elements' ),
611 'above' => esc_html__( 'Above Heading Title', 'easy-elements' ),
612 'below' => esc_html__( 'Below Heading Title', 'easy-elements' ),
613 'bottom' => esc_html__( 'Bottom of Widget', 'easy-elements' ),
614 ],
615 'description' => esc_html__( 'Where the separator sits inside the widget.', 'easy-elements' ),
616 'condition' => [
617 'separator_!' => 'none',
618 ],
619 ]
620 );
621
622 $this->add_control(
623 'separator_margin',
624 [
625 'label' => esc_html__( 'Margin', 'easy-elements' ),
626 'type' => \Elementor\Controls_Manager::DIMENSIONS,
627 'size_units' => [ 'px', '%', 'em' ],
628 'selectors' => [
629 '{{WRAPPER}} .eel--separator-icon, {{WRAPPER}} .eel--separator-icon-wrap' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
630 ],
631 'condition' => [
632 'separator_!' => 'none',
633 ],
634 ]
635 );
636
637 $this->end_controls_section();
638
639
640 $this->start_controls_section(
641 'water_mark_section',
642 [
643 'label' => esc_html__('WaterMark Settings', 'easy-elements'),
644 'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
645 ]
646 );
647
648 $this->add_control(
649 'water_mark',
650 [
651 'label' => esc_html__('WaterMark Text', 'easy-elements'),
652 'type' => \Elementor\Controls_Manager::TEXTAREA,
653 'label_block' => 'true',
654 ]
655 );
656
657 $this->add_control(
658 'water_mark_font_size',
659 [
660 'label' => esc_html__('Font Size', 'easy-elements'),
661 'type' => \Elementor\Controls_Manager::SLIDER,
662 'size_units' => ['px', 'em', 'rem', '%'],
663 'range' => [
664 'px' => ['min' => 10, 'max' => 300],
665 'em' => ['min' => 0.5, 'max' => 20],
666 'rem' => ['min' => 0.5, 'max' => 20],
667 '%' => ['min' => 10, 'max' => 500],
668 ],
669 'default' => [
670 'size' => '',
671 'unit' => 'px',
672 ],
673 'selectors' => [
674 '{{WRAPPER}} .eel-watermark' => 'font-size: {{SIZE}}{{UNIT}};',
675 ],
676 ]
677 );
678
679 $this->add_control(
680 '_mark_color',
681 [
682 'label' => esc_html__('Text Color', 'easy-elements'),
683 'type' => \Elementor\Controls_Manager::COLOR,
684 'default' => '',
685 'selectors' => [
686 '{{WRAPPER}} .eel-watermark' => 'color: {{VALUE}};',
687 ],
688 ]
689 );
690
691 $this->add_control(
692 'water_mark_color',
693 [
694 'label' => esc_html__('Stroke Color', 'easy-elements'),
695 'type' => \Elementor\Controls_Manager::COLOR,
696 'default' => 'rgba(0, 0, 0, 0.3)',
697 'selectors' => [
698 '{{WRAPPER}} .eel-watermark' => '-webkit-text-stroke-color: {{VALUE}}; text-stroke-color: {{VALUE}};',
699 ],
700 ]
701 );
702
703 $this->add_control(
704 'water_mark_stroke_width',
705 [
706 'label' => esc_html__('Stroke Width (px)', 'easy-elements'),
707 'type' => \Elementor\Controls_Manager::SLIDER,
708 'default' => [
709 'size' => 1,
710 'unit' => 'px',
711 ],
712 'range' => [
713 'px' => [
714 'min' => 0,
715 'max' => 10,
716 ],
717 ],
718 'selectors' => [
719 '{{WRAPPER}} .eel-watermark' => '-webkit-text-stroke-width: {{SIZE}}{{UNIT}}; text-stroke-width: {{SIZE}}{{UNIT}};',
720 ],
721 ]
722 );
723
724 $this->add_responsive_control(
725 'water_mark_top',
726 [
727 'label' => esc_html__('Top / Bottom', 'easy-elements'),
728 'type' => \Elementor\Controls_Manager::SLIDER,
729 'size_units' => ['px', '%', 'em'],
730 'range' => [
731 'px' => ['min' => -500, 'max' => 500],
732 '%' => ['min' => -100, 'max' => 100],
733 'em' => ['min' => -50, 'max' => 50],
734 ],
735 'selectors' => [
736 '{{WRAPPER}} .eel-watermark' => 'top: {{SIZE}}{{UNIT}};',
737 ],
738 ]
739 );
740
741 $this->add_responsive_control(
742 'water_mark_left',
743 [
744 'label' => esc_html__('Left / Right', 'easy-elements'),
745 'type' => \Elementor\Controls_Manager::SLIDER,
746 'size_units' => ['px', '%', 'em'],
747 'range' => [
748 'px' => ['min' => -500, 'max' => 500],
749 '%' => ['min' => 0, 'max' => 100],
750 'em' => ['min' => 0, 'max' => 50],
751 ],
752 'selectors' => [
753 '{{WRAPPER}} .eel-watermark' => 'left: {{SIZE}}{{UNIT}};',
754 ],
755 ]
756 );
757
758 $this->add_responsive_control(
759 'water_mark_z_index',
760 [
761 'label' => esc_html__('Z-Index', 'easy-elements'),
762 'type' => \Elementor\Controls_Manager::SLIDER,
763 'default' => [
764 'size' => -1,
765 ],
766 'range' => [
767 'px' => [
768 'min' => -10,
769 'max' => 9999,
770 ],
771 ],
772 'description' => esc_html__('Use a negative value (e.g. -1) to keep the watermark behind the heading.', 'easy-elements'),
773 'selectors' => [
774 '{{WRAPPER}} .eel-watermark' => 'z-index: {{SIZE}};',
775 ],
776 ]
777 );
778
779
780 $this->end_controls_section();
781
782
783
784 // Heading
785 $this->start_controls_section(
786 'section_heading_style',
787 [
788 'label' => esc_html__('Heading', 'easy-elements'),
789 'tab' => Controls_Manager::TAB_STYLE,
790 ]
791 );
792
793 $this->add_control(
794 'title_color',
795 [
796 'label' => esc_html__('Color', 'easy-elements'),
797 'type' => Controls_Manager::COLOR,
798 'selectors' => [
799 '{{WRAPPER}} .e-e-heading .e-e-title' => 'color: {{VALUE}};',
800 ],
801 'condition' => [
802 'show_gradient_title' => '',
803 ],
804 ]
805 );
806
807 $this->add_control(
808 'title_color_gradient_heading',
809 [
810 'label' => esc_html__('Text Gradient Color', 'easy-elements'),
811 'type' => Controls_Manager::HEADING,
812 'separator' => 'before',
813 'condition' => [
814 'show_gradient_title' => 'yes',
815 ]
816 ]
817 );
818
819 $this->add_group_control(
820 Group_Control_Background::get_type(),
821 [
822 'name' => 'title_gradient_color',
823 'label' => __( 'Title Color', 'easy-elements' ),
824 'types' => [ 'classic', 'gradient' ],
825 'selector' => '{{WRAPPER}} .e-e-heading .e-e-title.e-e-gradient-title',
826 'condition' => [
827 'show_gradient_title' => 'yes',
828 ],
829 ]
830 );
831
832
833 $this->add_group_control(
834 Group_Control_Typography::get_type(),
835 [
836 'name' => 'title_typography',
837 'label' => esc_html__('Typography', 'easy-elements'),
838 'selector' => '{{WRAPPER}} .e-e-heading .e-e-title',
839 ]
840 );
841 $this->add_control(
842 'title_opacity',
843 [
844 'label' => esc_html__('Opacity', 'easy-elements'),
845 'type' => Controls_Manager::SLIDER,
846 'selectors' => [
847 '{{WRAPPER}} .e-e-heading .e-e-title' => 'opacity: {{SIZE}};',
848 ],
849 'default' => [
850 'size' => 1,
851 'unit' => 'px',
852 ],
853 ]
854 );
855
856 $this->add_control(
857 'title_text_stroke',
858 [
859 'label' => esc_html__('Stroke Width', 'easy-elements'),
860 'type' => Controls_Manager::SLIDER,
861 'selectors' => [
862 '{{WRAPPER}} .e-e-heading .e-e-title' => '-webkit-text-stroke-width: {{SIZE}}{{UNIT}};',
863 ],
864 'default' => [
865 'size' => 0,
866 'unit' => 'px',
867 ],
868 ]
869 );
870 $this->add_control(
871 'title_text_stroke_color',
872 [
873 'label' => esc_html__('Stroke Color', 'easy-elements'),
874 'type' => Controls_Manager::COLOR,
875 'selectors' => [
876 '{{WRAPPER}} .e-e-heading .e-e-title' => '-webkit-text-stroke-color: {{VALUE}};',
877 ],
878 'condition' => [
879 'title_text_stroke[size]!' => '',
880 ],
881 ]
882 );
883 // Text Shadow
884 $this->add_group_control(
885 \Elementor\Group_Control_Text_Shadow::get_type(),
886 [
887 'name' => 'title_text_shadow',
888 'label' => esc_html__('Text Shadow', 'easy-elements'),
889 'selector' => '{{WRAPPER}} .e-e-heading .e-e-title',
890 ]
891 );
892 // Mix Blend Mode
893 $this->add_control(
894 'title_blend_mode',
895 [
896 'label' => esc_html__('Blend Mode', 'easy-elements'),
897 'type' => Controls_Manager::SELECT,
898 'options' => [
899 '' => esc_html__('Default', 'easy-elements'),
900 'normal' => 'Normal',
901 'multiply' => 'Multiply',
902 'screen' => 'Screen',
903 'overlay' => 'Overlay',
904 'darken' => 'Darken',
905 'lighten' => 'Lighten',
906 'color-dodge' => 'Color Dodge',
907 'color-burn' => 'Color Burn',
908 'hard-light' => 'Hard Light',
909 'soft-light' => 'Soft Light',
910 'difference' => 'Difference',
911 'exclusion' => 'Exclusion',
912 'hue' => 'Hue',
913 'saturation' => 'Saturation',
914 'color' => 'Color',
915 'luminosity' => 'Luminosity',
916 ],
917 'selectors' => [
918 '{{WRAPPER}} .e-e-heading .e-e-title' => 'mix-blend-mode: {{VALUE}};',
919 ],
920 ]
921 );
922 $this->add_responsive_control(
923 'title_margin',
924 [
925 'label' => esc_html__('Margin', 'easy-elements'),
926 'type' => Controls_Manager::DIMENSIONS,
927 'size_units' => ['px', 'em', '%'],
928 'selectors' => [
929 '{{WRAPPER}} .e-e-heading .e-e-title' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
930 ],
931 ]
932 );
933
934 $this->add_responsive_control(
935 'title_padding',
936 [
937 'label' => esc_html__('Padding', 'easy-elements'),
938 'type' => Controls_Manager::DIMENSIONS,
939 'size_units' => ['px', 'em', '%'],
940 'selectors' => [
941 '{{WRAPPER}} .e-e-heading .e-e-title' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
942 ],
943 ]
944 );
945
946
947 $this->add_control(
948 'title_image_fill_heading',
949 [
950 'label' => esc_html__('Image Fill (Text Mask)', 'easy-elements'),
951 'type' => Controls_Manager::HEADING,
952 'separator' => 'before',
953 ]
954 );
955
956 $this->add_control(
957 'enable_title_image_fill',
958 [
959 'label' => esc_html__('Enable Image Fill', 'easy-elements'),
960 'type' => \Elementor\Controls_Manager::SWITCHER,
961 'label_on' => esc_html__('Yes', 'easy-elements'),
962 'label_off' => esc_html__('No', 'easy-elements'),
963 'return_value' => 'yes',
964 'default' => '',
965 ]
966 );
967
968 $this->add_group_control(
969 Group_Control_Background::get_type(),
970 [
971 'name' => 'title_image_fill_bg',
972 'label' => esc_html__('Image Fill', 'easy-elements'),
973 'types' => [ 'classic' ],
974 'selector' => '{{WRAPPER}} .e-e-heading .e-e-title.e-e-image-fill, {{WRAPPER}} .e-e-heading .e-e-title.e-e-image-fill div',
975 'fields_options' => [
976 'background' => [
977 'default' => 'classic',
978 ],
979 'classic' => [
980 'types' => [ 'image' ],
981 ],
982 ],
983 'condition' => [
984 'enable_title_image_fill' => 'yes',
985 ],
986 ]
987 );
988
989 $this->add_control(
990 'title_image_fill_note',
991 [
992 'type' => Controls_Manager::RAW_HTML,
993 'raw' => __('Tip: Apply this only when you want the text to be filled with an image (the image will appear inside the text).', 'easy-elements'),
994 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info',
995 ]
996 );
997
998 $this->end_controls_section();
999
1000 //Sub Heading
1001 $this->start_controls_section(
1002 'section_sub_heading_style',
1003 [
1004 'label' => esc_html__('Sub Heading', 'easy-elements'),
1005 'tab' => Controls_Manager::TAB_STYLE,
1006 ]
1007 );
1008
1009 $this->add_control(
1010 'sub_heading_color',
1011 [
1012 'label' => esc_html__('Color', 'easy-elements'),
1013 'type' => Controls_Manager::COLOR,
1014 'selectors' => [
1015 '{{WRAPPER}} .e-e-heading .eel-sub-heading span' => 'color: {{VALUE}};',
1016 ],
1017 ]
1018 );
1019
1020 $this->add_group_control(
1021 \Elementor\Group_Control_Background::get_type(),
1022 [
1023 'name' => 'background_subtext',
1024 'types' => [ 'classic', 'gradient' ],
1025 'selector' => '{{WRAPPER}} .eel-sub-heading.top',
1026 'condition' => [
1027 'icon_direction' => 'top',
1028 ],
1029 ]
1030 );
1031
1032 $this->add_group_control(
1033 \Elementor\Group_Control_Background::get_type(),
1034 [
1035 'name' => 'background_subtext_top',
1036 'types' => [ 'classic', 'gradient' ],
1037 'selector' => '{{WRAPPER}} .eel-sub-heading',
1038 'condition' => [
1039 'icon_direction' => ['left', 'right'],
1040 ],
1041 ]
1042 );
1043
1044 $this->add_group_control(
1045 Group_Control_Typography::get_type(),
1046 [
1047 'name' => 'sub_heading_typography',
1048 'label' => esc_html__('Typography', 'easy-elements'),
1049 'selector' => '{{WRAPPER}} .e-e-heading .eel-sub-heading span',
1050 ]
1051 );
1052
1053 $this->add_responsive_control(
1054 'sub_heading_icon_text_gap',
1055 [
1056 'label' => esc_html__( 'Icon/Image to Text Gap', 'easy-elements' ),
1057 'type' => \Elementor\Controls_Manager::SLIDER,
1058 'size_units' => [ 'px', 'em', 'rem' ],
1059 'range' => [
1060 'px' => [ 'min' => 0, 'max' => 100 ],
1061 'em' => [ 'min' => 0, 'max' => 10 ],
1062 ],
1063 'selectors' => [
1064 '{{WRAPPER}} .eel-sub-heading.left, {{WRAPPER}} .eel-sub-heading.right' => 'gap: {{SIZE}}{{UNIT}};',
1065 '{{WRAPPER}} .eel-sub-heading.top i, {{WRAPPER}} .eel-sub-heading.top svg, {{WRAPPER}} .eel-sub-heading.top img' => 'margin-bottom: {{SIZE}}{{UNIT}};',
1066 ],
1067 'condition' => [
1068 'sub_heading_type' => [ 'icon', 'image' ],
1069 ],
1070 ]
1071 );
1072
1073 $this->add_group_control(
1074 \Elementor\Group_Control_Border::get_type(),
1075 [
1076 'name' => 'subtext_border',
1077 'label' => esc_html__( 'Border', 'easy-elements' ),
1078 'selector' => '{{WRAPPER}} .eel-sub-heading',
1079 ]
1080 );
1081
1082 $this->add_control(
1083 'subtext_icon_size',
1084 [
1085 'label' => esc_html__( 'Icon Size', 'easy-elements' ),
1086 'type' => \Elementor\Controls_Manager::SLIDER,
1087 'range' => [
1088 'px' => [
1089 'min' => 6,
1090 'max' => 100,
1091 ],
1092 ],
1093 'selectors' => [
1094 '{{WRAPPER}} .eel-sub-heading i, {{WRAPPER}} .eel-sub-heading svg' => 'font-size: {{SIZE}}{{UNIT}};',
1095 ],
1096 'description' => esc_html__( 'Adjust the icon size in pixels for the subheading icon.', 'easy-elements' ),
1097 'condition' => [
1098 'sub_heading_type' => 'icon',
1099 ],
1100 ]
1101 );
1102
1103 $this->add_responsive_control(
1104 'subtext_image_size',
1105 [
1106 'label' => esc_html__( 'Image Width', 'easy-elements' ),
1107 'type' => \Elementor\Controls_Manager::SLIDER,
1108 'size_units' => [ 'px', 'em', '%' ],
1109 'range' => [
1110 'px' => [
1111 'min' => 10,
1112 'max' => 300,
1113 ],
1114 '%' => [
1115 'min' => 1,
1116 'max' => 100,
1117 ],
1118 ],
1119 'selectors' => [
1120 '{{WRAPPER}} .eel-sub-heading img' => 'width: {{SIZE}}{{UNIT}}; height: auto;',
1121 ],
1122 'description' => esc_html__( 'Adjust the image width. Height stays auto to keep aspect ratio (override below).', 'easy-elements' ),
1123 'condition' => [
1124 'sub_heading_type' => 'image',
1125 ],
1126 ]
1127 );
1128
1129 $this->add_responsive_control(
1130 'subtext_image_height',
1131 [
1132 'label' => esc_html__( 'Image Height', 'easy-elements' ),
1133 'type' => \Elementor\Controls_Manager::SLIDER,
1134 'size_units' => [ 'px', 'em', '%' ],
1135 'range' => [
1136 'px' => [
1137 'min' => 10,
1138 'max' => 300,
1139 ],
1140 ],
1141 'selectors' => [
1142 '{{WRAPPER}} .eel-sub-heading img' => 'height: {{SIZE}}{{UNIT}};',
1143 ],
1144 'description' => esc_html__( 'Optional. Set a fixed height. Leave empty to keep auto height.', 'easy-elements' ),
1145 'condition' => [
1146 'sub_heading_type' => 'image',
1147 ],
1148 ]
1149 );
1150
1151 $this->add_responsive_control(
1152 'subtext_image_radius',
1153 [
1154 'label' => esc_html__( 'Image Border Radius', 'easy-elements' ),
1155 'type' => \Elementor\Controls_Manager::DIMENSIONS,
1156 'size_units' => [ 'px', '%' ],
1157 'selectors' => [
1158 '{{WRAPPER}} .eel-sub-heading img' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1159 ],
1160 'condition' => [
1161 'sub_heading_type' => 'image',
1162 ],
1163 ]
1164 );
1165
1166 $this->add_responsive_control(
1167 'subtext_border_radius',
1168 [
1169 'label' => esc_html__( 'Border Radius', 'easy-elements' ),
1170 'type' => \Elementor\Controls_Manager::DIMENSIONS,
1171 'size_units' => [ 'px', '%', 'em' ],
1172 'selectors' => [
1173 '{{WRAPPER}} .eel-sub-heading' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1174 ],
1175 ]
1176 );
1177
1178 $this->add_responsive_control(
1179 'subtext_padding',
1180 [
1181 'label' => esc_html__( 'Padding', 'easy-elements' ),
1182 'type' => \Elementor\Controls_Manager::DIMENSIONS,
1183 'size_units' => [ 'px', '%', 'em' ],
1184 'selectors' => [
1185 '{{WRAPPER}} .eel-sub-heading' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1186 ],
1187 ]
1188 );
1189
1190 $this->add_control(
1191 'sub_heading_margin',
1192 [
1193 'label' => esc_html__( 'Margin', 'easy-elements' ),
1194 'type' => \Elementor\Controls_Manager::DIMENSIONS,
1195 'size_units' => [ 'px', '%', 'em' ],
1196 'selectors' => [
1197 '{{WRAPPER}} .eel-sub-heading' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1198 ],
1199 ]
1200 );
1201
1202 $this->end_controls_section();
1203
1204
1205 // Highlight
1206 $this->start_controls_section(
1207 'section_highlight_style',
1208 [
1209 'label' => esc_html__('Highlight', 'easy-elements'),
1210 'tab' => Controls_Manager::TAB_STYLE,
1211 ]
1212 );
1213 $this->add_control(
1214 'highlight_color',
1215 [
1216 'label' => esc_html__('Color', 'easy-elements'),
1217 'type' => Controls_Manager::COLOR,
1218 'selectors' => [
1219 '{{WRAPPER}} .e-e-heading .e-e-title span' => 'color: {{VALUE}};',
1220 ],
1221 ]
1222 );
1223
1224 $this->add_group_control(
1225 \Elementor\Group_Control_Background::get_type(),
1226 [
1227 'name' => 'background_highlight',
1228 'types' => [ 'classic', 'gradient' ],
1229 'selector' => '{{WRAPPER}} .e-e-heading .e-e-title span',
1230 ]
1231 );
1232
1233 $this->add_group_control(
1234 Group_Control_Typography::get_type(),
1235 [
1236 'name' => 'highlight_typography',
1237 'label' => esc_html__('Highlight Typography', 'easy-elements'),
1238 'selector' => '{{WRAPPER}} .e-e-heading .e-e-title span',
1239 ]
1240 );
1241
1242 $this->add_responsive_control(
1243 'highlight_padding',
1244 [
1245 'label' => esc_html__( 'Padding', 'easy-elements' ),
1246 'type' => \Elementor\Controls_Manager::DIMENSIONS,
1247 'size_units' => [ 'px', '%', 'em' ],
1248 'selectors' => [
1249 '{{WRAPPER}} .e-e-heading .e-e-title span' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1250 ],
1251 ]
1252 );
1253
1254 $this->add_control(
1255 'highlight_margin',
1256 [
1257 'label' => esc_html__( 'Margin', 'easy-elements' ),
1258 'type' => \Elementor\Controls_Manager::DIMENSIONS,
1259 'size_units' => [ 'px', '%', 'em' ],
1260 'selectors' => [
1261 '{{WRAPPER}} .e-e-heading .e-e-title span' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1262 ],
1263 ]
1264 );
1265
1266 $this->add_responsive_control(
1267 'hithlight_border_radius',
1268 [
1269 'label' => esc_html__( 'Border Radius', 'easy-elements' ),
1270 'type' => \Elementor\Controls_Manager::DIMENSIONS,
1271 'size_units' => [ 'px', '%', 'em' ],
1272 'selectors' => [
1273 '{{WRAPPER}} .e-e-heading .e-e-title span' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1274 ],
1275 ]
1276 );
1277
1278 $this->end_controls_section();
1279
1280 // Description
1281 $this->start_controls_section(
1282 'section_description_style',
1283 [
1284 'label' => esc_html__('Description', 'easy-elements'),
1285 'tab' => Controls_Manager::TAB_STYLE,
1286 ]
1287 );
1288 $this->add_control(
1289 'description_color',
1290 [
1291 'label' => esc_html__('Color', 'easy-elements'),
1292 'type' => Controls_Manager::COLOR,
1293 'selectors' => [
1294 '{{WRAPPER}} .e-e-heading .e-e-description' => 'color: {{VALUE}};',
1295 ],
1296 ]
1297 );
1298 $this->add_group_control(
1299 Group_Control_Typography::get_type(),
1300 [
1301 'name' => 'description_typography',
1302 'label' => esc_html__('Typography', 'easy-elements'),
1303 'selector' => '{{WRAPPER}} .e-e-heading .e-e-description',
1304 ]
1305 );
1306 $this->add_responsive_control(
1307 'description_margin',
1308 [
1309 'label' => esc_html__('Margin', 'easy-elements'),
1310 'type' => Controls_Manager::DIMENSIONS,
1311 'size_units' => ['px', 'em', '%'],
1312 'selectors' => [
1313 '{{WRAPPER}} .e-e-heading .e-e-description' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1314 ],
1315 ]
1316 );
1317 $this->add_responsive_control(
1318 'description_padding',
1319 [
1320 'label' => esc_html__('Padding', 'easy-elements'),
1321 'type' => Controls_Manager::DIMENSIONS,
1322 'size_units' => ['px', 'em', '%'],
1323 'selectors' => [
1324 '{{WRAPPER}} .e-e-heading .e-e-description' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1325 ],
1326 ]
1327 );
1328 $this->end_controls_section();
1329 }
1330
1331 protected function render_separator( $settings ) {
1332 if ( ! empty( $settings['separator_'] ) && in_array( $settings['separator_'], ['dotted', 'solid'], true ) ) {
1333 echo '<div class="eel--separator-icon ' . esc_attr( $settings['separator_'] ) . '"></div>';
1334 }
1335
1336 if ( 'icon' === $settings['separator_'] && ! empty( $settings['select_icon_']['value'] ) ) {
1337 echo '<div class="eel--separator-icon-wrap">';
1338 \Elementor\Icons_Manager::render_icon( $settings['select_icon_'], [ 'aria-hidden' => 'true' ] );
1339 echo '</div>';
1340 }
1341 if ( isset( $settings['separator_'] ) && 'image' === $settings['separator_'] && ! empty( $settings['sep_image']['url'] ) ) {
1342 echo '<div class="eel--separator-icon-wrap">';
1343 printf(
1344 '<img src="%s" alt="%s" title="%s" class="eel-separator-img" loading="lazy" decoding="async" />',
1345 esc_url( $settings['sep_image']['url'] ),
1346 esc_attr__( 'Separator Image', 'easy-elements' ),
1347 esc_attr__( 'Separator Image', 'easy-elements' )
1348 );
1349
1350 echo '</div>';
1351 }
1352 }
1353
1354 protected function render() {
1355 $settings = $this->get_settings_for_display();
1356
1357 $tag = isset($settings['title_tag']) ? $settings['title_tag'] : 'h2';
1358 $title = preg_replace_callback( '/\{\{(.*?)\}\}/', function( $matches ) {
1359 return '<span>' . esc_html( trim( $matches[1] ) ) . '</span>';
1360 }, $settings['title'] );
1361
1362 if ( ! empty( $settings['link']['url'] ) ) {
1363 $this->add_link_attributes( 'title_link', $settings['link'] );
1364 $title = sprintf(
1365 '<a %s>%s</a>',
1366 $this->get_render_attribute_string( 'title_link' ),
1367 $title
1368 );
1369 }
1370
1371 $border_position = $settings['border_position'] ?? '';
1372 $unique_id = 'eel-heading-' . $this->get_id();
1373 $animation = isset( $settings['animation_type'] ) && ! empty($settings['animation_type']) ? $settings['animation_type'] : '';
1374 ?>
1375 <div class="e-e-heading <?php echo esc_attr($border_position); ?>" <?php if(!empty($animation)) : ?>
1376 data-eel-animation="<?php echo esc_attr($animation); ?>"
1377 <?php endif; ?>>
1378 <?php
1379 $icon_direction = $settings['icon_direction'] ?? '' ;
1380 $separator_position = ! empty( $settings['separator_position'] ) ? $settings['separator_position'] : 'default';
1381
1382 if ( in_array( $separator_position, ['top'], true ) ) {
1383 if ( ! empty( $settings['separator_'] ) ) {
1384 $this->render_separator( $settings );
1385 }
1386 }
1387
1388 if ( ! empty( $settings['sub_title'] ) ) : ?>
1389 <div class="eel-sub-heading <?php echo esc_attr($icon_direction); ?> <?php echo esc_attr($settings['show_gradient_border'] == 'yes' ? 'easy_gradiant_border' : ''); ?>">
1390 <?php
1391 $this->add_inline_editing_attributes( 'sub_title' );
1392 if ( 'icon' === $settings['sub_heading_type'] && ! empty( $settings['sub_heading_icon']['value'] ) ) {
1393 \Elementor\Icons_Manager::render_icon( $settings['sub_heading_icon'], [ 'aria-hidden' => 'true' ] );
1394 } elseif ( 'image' === $settings['sub_heading_type'] && ! empty( $settings['sub_heading_image']['url'] ) ) {
1395 if ( ! empty( $settings['sub_heading_image']['id'] ) ) {
1396 echo wp_get_attachment_image(
1397 $settings['sub_heading_image']['id'],
1398 'full',
1399 false,
1400 ['alt' => $settings['sub_heading_image']['alt'] ?? '']
1401 );
1402 } elseif ( ! empty( $settings['sub_heading_image']['url'] ) ) {
1403 echo '<img src="' . esc_url( $settings['sub_heading_image']['url'] ) . '" alt="">';
1404 }
1405 }
1406
1407 ?>
1408 <span class="elementor-inline-editing" <?php
1409 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
1410 echo $this->get_render_attribute_string( 'sub_title' ); ?>>
1411 <?php
1412 echo wp_kses_post( $settings['sub_title'] );
1413 ?>
1414 </span>
1415 </div>
1416 <?php endif;
1417
1418 if ( in_array( $separator_position, ['above'], true ) ) {
1419 if ( ! empty( $settings['separator_'] ) ) {
1420 $this->render_separator( $settings );
1421 }
1422 }
1423
1424 $allowed_tags = ['h1','h2','h3','h4','h5','h6','div','span'];
1425 $tag = in_array(strtolower($tag), $allowed_tags, true) ? strtolower($tag) : 'div';
1426
1427
1428 if ( ! empty( $title ) ) {
1429 $gradient_class = ! empty( $settings['show_gradient_title'] ) ? ' e-e-gradient-title' : '';
1430 $image_fill_class = ( ! empty( $settings['enable_title_image_fill'] ) ) ? ' e-e-image-fill' : '';
1431 $tag_class = 'e-e-title elementor-inline-editing' . $gradient_class . $image_fill_class;
1432
1433 // Inline editing attribute add
1434 $this->add_inline_editing_attributes( 'title' );
1435
1436 printf(
1437 '<%1$s class="%2$s" %3$s>%4$s</%1$s>',
1438 esc_html( $tag ),
1439 esc_attr( $tag_class ),
1440 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
1441 $this->get_render_attribute_string( 'title' ),
1442 wp_kses_post( $title )
1443 );
1444 }
1445
1446
1447
1448 if ( in_array( $separator_position, ['below'], true ) ) {
1449 if ( ! empty( $settings['separator_'] ) ) {
1450 $this->render_separator( $settings );
1451 }
1452 }
1453
1454 if ( ! empty( $settings['description'] ) ) {
1455 $this->add_inline_editing_attributes( 'description' );
1456 ?>
1457 <div class="e-e-description elementor-inline-editing" <?php
1458 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
1459 echo $this->get_render_attribute_string( 'description' ); ?>>
1460 <?php echo wp_kses_post( $settings['description'] ); ?>
1461 </div>
1462 <?php }
1463 if ( in_array( $separator_position, ['bottom'], true ) ) {
1464 if ( ! empty( $settings['separator_'] ) ) {
1465 $this->render_separator( $settings );
1466 }
1467 }
1468
1469 if ( ! empty( $settings['water_mark'] ) ) {
1470 echo '<div class="eel-watermark">';
1471 echo esc_html( $settings['water_mark'] );
1472 echo '</div>';
1473 }
1474
1475 ?>
1476 </div>
1477 <?php }
1478 }