PluginProbe
Master Addons for Elementor – Elementor Addons, Widgets, Mega Menu Builder, Popup Builder, Widget Builder & Template Kits / 3.2.3
Master Addons for Elementor – Elementor Addons, Widgets, Mega Menu Builder, Popup Builder, Widget Builder & Template Kits v3.2.3
3.2.2 3.2.3 3.2.1 3.2.0 3.1.9 3.1.8 3.1.7 3.1.6 3.1.5 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 3.0.9 trunk 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.1.3 1.1.4 1.1.5 All 174 releases
master-addons / addons / basic / ma-dual-heading / ma-dual-heading.php

ma-dual-heading.php in Master Addons for Elementor – Elementor Addons, Widgets, Mega Menu Builder, Popup Builder, Widget Builder & Template Kits 3.2.3, at addons/basic/ma-dual-heading/ma-dual-heading.php

683 lines 22.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace MasterAddons\Addons;
4
5 use MasterAddons\Inc\Classes\Base\Master_Widget;
6 use \Elementor\Controls_Manager;
7 use \Elementor\Controls_Stack;
8 use \Elementor\Utils;
9 use \Elementor\Group_Control_Border;
10 use \Elementor\Core\Kits\Documents\Tabs\Global_Typography;
11 use \Elementor\Group_Control_Box_Shadow;
12 use \Elementor\Group_Control_Typography;
13
14 use MasterAddons\Inc\Classes\Helper;
15 use MasterAddons\Inc\Admin\Config;
16
17 if (!defined('ABSPATH')) exit; // If this file is called directly, abort.
18
19 class Dual_Heading extends Master_Widget
20 {
21 use \MasterAddons\Inc\Traits\Widget_Notice;
22 use \MasterAddons\Inc\Traits\Widget_Assets_Trait;
23
24 public function get_name()
25 {
26 return 'ma-dual-heading';
27 }
28
29 public function get_title()
30 {
31 return esc_html__('Dual Heading', 'master-addons' );
32 }
33
34 public function get_icon()
35 {
36 return 'jltma-icon ' . Config::get_addon_icon($this->get_name());
37 }
38
39 public function get_keywords()
40 {
41 return ['heading', 'headlines', 'dual headline', 'gradient', 'gradient heading', 'gradient headlines'];
42 }
43
44 protected function register_controls()
45 {
46
47 /**
48 * Master Addons: Dual Heading Content Section
49 */
50 $this->start_controls_section(
51 'ma_el_dual_heading_content',
52 [
53 'label' => esc_html__('Content', 'master-addons' ),
54 ]
55 );
56
57 $this->add_control(
58 'ma_el_dual_heading_styles_preset',
59 [
60 'label' => esc_html__('Style Preset', 'master-addons' ),
61 'type' => Controls_Manager::SELECT,
62 'default' => '-style2',
63 'options' => [
64 '-style1' => esc_html__('Style 1', 'master-addons' ),
65 '-style2' => esc_html__('Style 2', 'master-addons' ),
66 // '-style3' => esc_html__('Background Text', 'master-addons' ),
67 ],
68 ]
69 );
70
71 $this->add_responsive_control(
72 'ma_el_dual_heading_alignment',
73 [
74 'label' => esc_html__('Alignment', 'master-addons' ),
75 'type' => Controls_Manager::CHOOSE,
76 'label_block' => false,
77 'options' => [
78 'left' => [
79 'title' => esc_html__('Left', 'master-addons' ),
80 'icon' => 'eicon-text-align-left',
81 ],
82 'center' => [
83 'title' => esc_html__('Center', 'master-addons' ),
84 'icon' => 'eicon-text-align-center',
85 ],
86 'right' => [
87 'title' => esc_html__('Right', 'master-addons' ),
88 'icon' => 'eicon-text-align-right',
89 ],
90 ],
91 'default' => 'center',
92 'selectors' => [
93 '{{WRAPPER}} .jltma-dual-heading .jltma-dual-heading-wrapper, {{WRAPPER}} .jltma-sec-head-style' => 'text-align: {{VALUE}};',
94 ],
95 ]
96 );
97
98 $this->add_control(
99 'ma_el_dual_first_heading',
100 [
101 'label' => esc_html__('First Heading', 'master-addons' ),
102 'type' => Controls_Manager::TEXT,
103 'label_block' => true,
104 'default' => esc_html__('First', 'master-addons' ),
105 ]
106 );
107
108 $this->add_control(
109 'ma_el_dual_second_heading',
110 [
111 'label' => esc_html__('Second Heading', 'master-addons' ),
112 'type' => Controls_Manager::TEXT,
113 'label_block' => true,
114 'default' => esc_html__('Second', 'master-addons' ),
115 ]
116 );
117
118 $this->add_control(
119 'ma_el_dual_heading_title_link',
120 [
121 'label' => esc_html__('Heading URL', 'master-addons' ),
122 'type' => Controls_Manager::URL,
123 'placeholder' => esc_html__('https://master-addons.com', 'master-addons' ),
124 'label_block' => true,
125 'condition' => [
126 'ma_el_dual_heading_styles_preset' => '-style2',
127 ],
128 ]
129 );
130
131 $this->add_control(
132 'ma_el_dual_heading_description',
133 [
134 'label' => esc_html__('Sub Heading', 'master-addons' ),
135 'type' => Controls_Manager::TEXTAREA,
136 'label_block' => true,
137 'dynamic' => ['active' => true],
138 'default' => __('Lorem ipsum dolor sit amet, consectetur adipisicing elit. Architecto modi vel repudiandae reiciendis, cupiditate quod voluptatibus, placeat ad assumenda molestiae alias quisquam', 'master-addons' ),
139 ]
140 );
141
142 $this->add_control(
143 'ma_el_dual_heading_icon_show',
144 [
145 'label' => esc_html__('Enable Icon', 'master-addons' ),
146 'type' => Controls_Manager::SWITCHER,
147 'default' => 'no',
148 'return_value' => 'yes',
149 'condition' => [
150 'ma_el_dual_heading_styles_preset' => '-style2',
151 ],
152 ]
153 );
154
155 $this->add_control(
156 'ma_el_dual_heading_icon',
157 [
158 'label' => esc_html__('Icon', 'master-addons' ),
159 'description' => esc_html__('Please choose an icon from the list.', 'master-addons' ),
160 'type' => Controls_Manager::ICONS,
161 'fa4compatibility' => 'icon',
162 'default' => [
163 'value' => 'fab fa-elementor',
164 'library' => 'brand',
165 ],
166 'render_type' => 'template',
167 'condition' => [
168 'ma_el_dual_heading_icon_show' => 'yes',
169 'ma_el_dual_heading_styles_preset' => '-style2',
170 ]
171 ]
172 );
173
174 $this->add_control(
175 'title_html_tag',
176 [
177 'label' => __('Heading Tag', 'master-addons' ),
178 'type' => Controls_Manager::CHOOSE,
179 'options' => Helper::jltma_heading_tags(),
180 'default' => 'h1',
181 ]
182 );
183
184 $this->end_controls_section();
185
186 /*
187 * Master Addons: Dual Heading First Part Styling Section
188 */
189 $this->start_controls_section(
190 'ma_el_dual_first_heading_styles',
191 [
192 'label' => esc_html__('First Heading', 'master-addons' ),
193 'tab' => Controls_Manager::TAB_STYLE
194 ]
195 );
196
197 $this->add_control(
198 'ma_el_dual_heading_first_text_color',
199 [
200 'label' => esc_html__('Text Color', 'master-addons' ),
201 'type' => Controls_Manager::COLOR,
202 'default' => '#1fb5ac',
203 'selectors' => [
204 '{{WRAPPER}} .jltma-dual-heading .jltma-dual-heading-wrapper .jltma-dual-heading-title .jltma-first-heading, {{WRAPPER}} .jltma-section-title span'
205 => 'color: {{VALUE}};',
206 ],
207 ]
208 );
209
210 $this->add_control(
211 'ma_el_dual_heading_first_bg_color',
212 [
213 'label' => __('Background', 'master-addons' ),
214 'type' => Controls_Manager::COLOR,
215 'default' => '#704aff',
216 'selectors' => [
217 '{{WRAPPER}} .jltma-dual-heading .jltma-dual-heading-wrapper .jltma-dual-heading-title .jltma-first-heading, {{WRAPPER}} .jltma-sec-head-container .jltma-sec-head-style:after'
218 => 'background-color: {{VALUE}};',
219 ],
220 ]
221 );
222
223 // $this->add_responsive_control(
224 // 'ma_el_dual_first_heading_alignment',
225 // [
226 // 'label' => esc_html__('Alignment', 'master-addons' ),
227 // 'type' => Controls_Manager::CHOOSE,
228 // 'label_block' => false,
229 // 'options' => [
230 // 'left' => [
231 // 'title' => esc_html__('Left', 'master-addons' ),
232 // 'icon' => 'eicon-text-align-left',
233 // ],
234 // 'center' => [
235 // 'title' => esc_html__('Center', 'master-addons' ),
236 // 'icon' => 'eicon-text-align-center',
237 // ],
238 // 'right' => [
239 // 'title' => esc_html__('Right', 'master-addons' ),
240 // 'icon' => 'eicon-text-align-right',
241 // ],
242 // ],
243 // 'default' => 'center',
244 // 'selectors' => [
245 // '{{WRAPPER}} .jltma-dual-heading-title' => 'text-align: {{VALUE}};',
246 // ],
247 // 'condition' => [
248 // 'ma_el_dual_heading_styles_preset' => '-style2',
249 // ],
250 // ]
251 // );
252
253 $this->add_group_control(
254 Group_Control_Typography::get_type(),
255 [
256 'name' => 'ma_el_dual_first_heading_typography',
257 'global' => [
258 'default' => Global_Typography::TYPOGRAPHY_PRIMARY,
259 ],
260 'selector' => '{{WRAPPER}} .jltma-dual-heading .jltma-dual-heading-wrapper .jltma-dual-heading-title .jltma-first-heading,{{WRAPPER}} .jltma-section-title span',
261 ]
262 );
263
264 $this->add_responsive_control(
265 'ma_el_dual_first_heading_padding',
266 [
267 'label' => __('Padding', 'master-addons' ),
268 'type' => Controls_Manager::DIMENSIONS,
269 'size_units' => ['px', 'em', '%'],
270 'selectors' => [
271 '{{WRAPPER}} .jltma-dual-heading .jltma-dual-heading-wrapper .jltma-dual-heading-title .jltma-first-heading,{{WRAPPER}} .jltma-section-title span' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
272 ],
273 ]
274 );
275
276 $this->add_responsive_control(
277 'ma_el_dual_first_heading_margin',
278 [
279 'label' => __('Margin', 'master-addons' ),
280 'type' => Controls_Manager::DIMENSIONS,
281 'size_units' => ['px', 'em', '%'],
282 'selectors' => [
283 '{{WRAPPER}} .jltma-dual-heading .jltma-dual-heading-wrapper .jltma-dual-heading-title .jltma-first-heading,{{WRAPPER}} .jltma-section-title span' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
284 ],
285 ]
286 );
287
288 $this->end_controls_section();
289
290 /*
291 * Master Addons: Dual Heading Second Part Styling Section
292 */
293 $this->start_controls_section(
294 'ma_el_dual_second_heading_styles',
295 [
296 'label' => esc_html__('Second Heading', 'master-addons' ),
297 'tab' => Controls_Manager::TAB_STYLE
298 ]
299 );
300
301 $this->add_control(
302 'ma_el_dual_heading_second_text_color',
303 [
304 'label' => esc_html__('Text Color', 'master-addons' ),
305 'type' => Controls_Manager::COLOR,
306 'default' => '#132C47',
307 'selectors' => [
308 '{{WRAPPER}} .jltma-dual-heading .jltma-dual-heading-wrapper .jltma-dual-heading-title .jltma-second-heading,
309 {{WRAPPER}} .jltma-section-title' =>
310 'color: {{VALUE}};',
311 ],
312
313 ]
314 );
315
316 $this->add_control(
317 'ma_el_dual_heading_second_bg_color',
318 [
319 'label' => __('Background', 'master-addons' ),
320 'type' => Controls_Manager::COLOR,
321 'selectors' => [
322 '{{WRAPPER}} .jltma-dual-heading .jltma-dual-heading-wrapper .jltma-dual-heading-title .jltma-second-heading' =>
323 'background-color: {{VALUE}};',
324 ],
325
326 'condition' => [
327 'ma_el_dual_heading_styles_preset' => '-style2',
328 ],
329 ]
330 );
331
332 $this->add_group_control(
333 Group_Control_Typography::get_type(),
334 [
335 'name' => 'ma_el_dual_second_heading_typography',
336 'global' => [
337 'default' => Global_Typography::TYPOGRAPHY_PRIMARY,
338 ],
339 'selector' =>
340 '{{WRAPPER}} .jltma-dual-heading .jltma-dual-heading-wrapper .jltma-dual-heading-title .jltma-second-heading, {{WRAPPER}} .jltma-section-title',
341 ]
342 );
343
344 $this->add_responsive_control(
345 'ma_el_dual_second_heading_padding',
346 [
347 'label' => __('Padding', 'master-addons' ),
348 'type' => Controls_Manager::DIMENSIONS,
349 'size_units' => ['px', 'em', '%'],
350 'selectors' => [
351 '{{WRAPPER}} .jltma-dual-heading .jltma-second-heading,
352 {{WRAPPER}} .jltma-section-description' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
353 ],
354 ]
355 );
356
357 $this->add_responsive_control(
358 'ma_el_dual_second_heading_margin',
359 [
360 'label' => __('Margin', 'master-addons' ),
361 'type' => Controls_Manager::DIMENSIONS,
362 'size_units' => ['px', 'em', '%'],
363 'selectors' => [
364 '{{WRAPPER}} .jltma-dual-heading .jltma-second-heading,
365 {{WRAPPER}} .jltma-section-description' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
366 ],
367 ]
368 );
369 $this->end_controls_section();
370
371 /*
372 * Master Addons: Dual Heading description Styling Section
373 */
374 $this->start_controls_section(
375 'ma_el_dual_heading_description_styles',
376 [
377 'label' => esc_html__('Description', 'master-addons' ),
378 'tab' => Controls_Manager::TAB_STYLE
379 ]
380 );
381
382 // $this->add_responsive_control(
383 // 'ma_el_dual_desc_heading_alignment',
384 // [
385 // 'label' => esc_html__('Alignment', 'master-addons' ),
386 // 'type' => Controls_Manager::CHOOSE,
387 // 'label_block' => false,
388 // 'options' => [
389 // 'left' => [
390 // 'title' => esc_html__('Left', 'master-addons' ),
391 // 'icon' => 'eicon-text-align-left',
392 // ],
393 // 'center' => [
394 // 'title' => esc_html__('Center', 'master-addons' ),
395 // 'icon' => 'eicon-text-align-center',
396 // ],
397 // 'right' => [
398 // 'title' => esc_html__('Right', 'master-addons' ),
399 // 'icon' => 'eicon-text-align-right',
400 // ],
401 // ],
402 // 'default' => 'center',
403 // 'selectors' => [
404 // '{{WRAPPER}} .jltma-dual-heading-description' => 'text-align: {{VALUE}};',
405 // ],
406 // 'condition' => [
407 // 'ma_el_dual_heading_styles_preset' => '-style2',
408 // ],
409 // ]
410 // );
411 $this->add_control(
412 'ma_el_dual_heading_description_text_color',
413 [
414 'label' => esc_html__('Text Color', 'master-addons' ),
415 'type' => Controls_Manager::COLOR,
416 'default' => '#989B9E',
417 'selectors' => [
418 '{{WRAPPER}} .jltma-dual-heading .jltma-dual-heading-wrapper .jltma-dual-heading-description,
419 {{WRAPPER}} .jltma-section-description' =>
420 'color: {{VALUE}};',
421 ],
422 ]
423 );
424 $this->add_group_control(
425 Group_Control_Typography::get_type(),
426 [
427 'name' => 'ma_el_dual_heading_description_typography',
428 'global' => [
429 'default' => Global_Typography::TYPOGRAPHY_PRIMARY,
430 ],
431 'selector' => '{{WRAPPER}} .jltma-dual-heading .jltma-dual-heading-wrapper .jltma-dual-heading-description,
432 {{WRAPPER}} .jltma-section-description',
433 ]
434 );
435 $this->add_responsive_control(
436 'ma_el_dual_description_padding',
437 [
438 'label' => __('Padding', 'master-addons' ),
439 'type' => Controls_Manager::DIMENSIONS,
440 'size_units' => ['px', 'em', '%'],
441 'selectors' => [
442 '{{WRAPPER}} .jltma-dual-heading .jltma-dual-heading-description,
443 {{WRAPPER}} .jltma-section-description' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
444 ],
445 ]
446 );
447
448 $this->add_responsive_control(
449 'ma_el_dual_description_margin',
450 [
451 'label' => __('Margin', 'master-addons' ),
452 'type' => Controls_Manager::DIMENSIONS,
453 'size_units' => ['px', 'em', '%'],
454 'selectors' => [
455 '{{WRAPPER}} .jltma-dual-heading .jltma-dual-heading-description,
456 {{WRAPPER}} .jltma-section-description' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
457 ],
458 ]
459 );
460
461 $this->end_controls_section();
462
463 /*
464 * Master Addons: Icon Styling
465 */
466 $this->start_controls_section(
467 'ma_el_dual_heading_icon_style',
468 [
469 'label' => esc_html__('Icon Style', 'master-addons' ),
470 'tab' => Controls_Manager::TAB_STYLE,
471 'condition' => [
472 'ma_el_dual_heading_icon_show' => 'yes',
473 'ma_el_dual_heading_styles_preset' => '-style2'
474 ],
475 ]
476 );
477
478 $this->add_control(
479 'ma_el_dual_heading_icon_size',
480 [
481 'label' => __('Icon Size (px)', 'master-addons' ),
482 'type' => Controls_Manager::SLIDER,
483 'default' => [
484 'size' => 40,
485 ],
486 'range' => [
487 'px' => [
488 'min' => 40,
489 'max' => 500,
490 ],
491 ],
492 'selectors' => [
493 '{{WRAPPER}} .jltma-dual-heading-icon i' => 'font-size: {{SIZE}}{{UNIT}};',
494 '{{WRAPPER}} .jltma-dual-heading-icon svg' => 'width: {{SIZE}}{{UNIT}};',
495 ],
496 ]
497 );
498
499 $this->start_controls_tabs('ma_el_dual_heading_icon_style_tabs');
500
501 $this->start_controls_tab('normal', ['label' => esc_html__('Normal', 'master-addons' )]);
502
503 $this->add_control(
504 'ma_el_dual_heading_icon_style_color',
505 [
506 'label' => esc_html__('Icon Color', 'master-addons' ),
507 'type' => Controls_Manager::COLOR,
508 'default' => '#8c8c8c',
509 'selectors' => [
510 '{{WRAPPER}} .jltma-dual-heading-icon i' => 'color: {{VALUE}};',
511 '{{WRAPPER}} .jltma-dual-heading-icon svg path' => 'color: {{VALUE}};'
512 ],
513 ]
514 );
515
516 $this->end_controls_tab();
517
518 $this->start_controls_tab(
519 'ma_el_dual_heading_icon_hover_color',
520 [
521 'label' => esc_html__('Hover', 'master-addons' )
522 ]
523 );
524
525 $this->add_control(
526 'ma_el_dual_heading_icon_size_hover',
527 [
528 'label' => __('Size', 'master-addons' ),
529 'type' => Controls_Manager::SLIDER,
530 'default' => [
531 'size' => 40,
532 ],
533 'range' => [
534 'px' => [
535 'min' => 40,
536 'max' => 500,
537 ],
538 ],
539 'selectors' => [
540 '{{WRAPPER}} .jltma-dual-heading-icon i:hover' => 'font-size: {{SIZE}}{{UNIT}};',
541 ],
542 ]
543 );
544
545 $this->add_control(
546 'ma_el_dual_heading_icon_style_hover_text_color',
547 [
548 'label' => esc_html__('Icon Color', 'master-addons' ),
549 'type' => Controls_Manager::COLOR,
550 'default' => '#8c8c8c',
551 'selectors' => [
552 '{{WRAPPER}} .jltma-dual-heading-icon i:hover' => 'color: {{VALUE}};'
553 ],
554 ]
555 );
556 $this->end_controls_tab();
557
558 $this->end_controls_section();
559
560 // Help Docs section (links from config.php)
561 $this->jltma_help_docs();
562
563 $this->upgrade_to_pro_message();
564 }
565
566 protected function render()
567 {
568 $settings = $this->get_settings_for_display();
569
570 ?>
571
572 <?php if ($settings['ma_el_dual_heading_styles_preset'] == '-style1') { ?>
573
574 <div class="jltma-sec-head-container">
575 <div class="jltma-sec-head-style">
576 <<?php echo Utils::print_validated_html_tag( $settings['title_html_tag'] ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- print_validated_html_tag returns a whitelisted tag name ?> class="jltma-section-title"><span><?php echo esc_html($settings['ma_el_dual_first_heading']); ?></span><br><?php echo esc_html($settings['ma_el_dual_second_heading']); ?></<?php echo Utils::print_validated_html_tag( $settings['title_html_tag'] ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- print_validated_html_tag returns a whitelisted tag name ?>><!-- /.section-title -->
577
578 <?php if ($settings['ma_el_dual_heading_description'] != "") : ?>
579 <div class="jltma-section-description"><?php echo wp_kses_post($this->parse_text_editor($settings['ma_el_dual_heading_description'])); ?></div><!-- /.section-description -->
580 <?php endif; ?>
581 </div><!-- /.sec-head-style -->
582 </div><!-- /.sec-head-container -->
583
584 <?php } elseif ($settings['ma_el_dual_heading_styles_preset'] == '-style2') { ?>
585
586 <div id="jltma-heading-<?php echo esc_attr($this->get_id()); ?>" class="jltma-dual-heading">
587 <div class="jltma-dual-heading-wrapper">
588 <?php if ($settings['ma_el_dual_heading_icon_show'] == 'yes') : ?>
589 <span class="jltma-dual-heading-icon">
590 <?php
591 $migrated = isset($settings['__fa4_migrated']['ma_el_dual_heading_icon']);
592 $is_new = empty($settings['icon']) && \Elementor\Icons_Manager::is_migration_allowed();
593
594 if ($is_new || $migrated){
595 \Elementor\Icons_Manager::render_icon($settings['ma_el_dual_heading_icon'], ['aria-hidden' => 'true']);
596 } else { ?>
597 <i class="<?php echo esc_attr($settings['icon']); ?>" aria-hidden="true"></i>
598 <?php } ?>
599 </span>
600 <?php endif; ?>
601
602 <<?php echo Utils::print_validated_html_tag( $settings['title_html_tag'] ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- print_validated_html_tag returns a whitelisted tag name ?> class="jltma-dual-heading-title">
603 <?php if (isset($settings['ma_el_dual_heading_title_link']['url']) && $settings['ma_el_dual_heading_title_link']['url'] != "") {
604 $this->add_link_attributes('ma_el_dual_heading_title_link', $settings['ma_el_dual_heading_title_link']); ?>
605 <a <?php echo $this->get_render_attribute_string('ma_el_dual_heading_title_link'); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Elementor get_render_attribute_string() returns safe HTML attributes ?>>
606 <?php } ?>
607
608 <span class="jltma-first-heading"><?php echo esc_html($this->parse_text_editor($settings['ma_el_dual_first_heading'])); ?></span><span class="jltma-second-heading"><?php echo esc_html($this->parse_text_editor($settings['ma_el_dual_second_heading'])); ?></span>
609
610 <?php if (isset($settings['ma_el_dual_heading_title_link']['url']) && $settings['ma_el_dual_heading_title_link']['url'] != "") { ?>
611 </a>
612 <?php } ?>
613 </<?php echo Utils::print_validated_html_tag( $settings['title_html_tag'] ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- print_validated_html_tag returns a whitelisted tag name ?>>
614
615 <?php if ($settings['ma_el_dual_heading_description'] != "") : ?>
616 <p class="jltma-dual-heading-description"><?php echo wp_kses_post($this->parse_text_editor($settings['ma_el_dual_heading_description'])); ?></p>
617 <?php endif; ?>
618 </div>
619 </div>
620
621 <?php } ?>
622
623 <?php
624 }
625
626 protected function content_template()
627 { ?>
628
629 <# if ( '-style1'==settings.ma_el_dual_heading_styles_preset ) { #>
630
631 <# var dhTitleTag = settings.title_html_tag || 'h2'; #>
632 <div class="jltma-sec-head-container">
633 <div class="jltma-sec-head-style">
634 <{{ dhTitleTag }} class="jltma-section-title"><span>{{{ settings.ma_el_dual_first_heading }}}</span><br>{{{ settings.ma_el_dual_second_heading }}}</{{ dhTitleTag }}><!-- /.section-title -->
635
636 <# if ( settings.ma_el_dual_heading_description !== '' ) { #>
637 <div class="jltma-section-description">{{{ settings.ma_el_dual_heading_description }}}</div><!-- /.section-description -->
638 <# } #>
639 </div><!-- /.sec-head-style -->
640 </div><!-- /.sec-head-container -->
641
642 <# } else{ #>
643
644 <div id="jltma-heading" class="jltma-dual-heading">
645 <div class="jltma-dual-heading-wrapper">
646 <# if ( settings.ma_el_dual_heading_icon_show=='yes' ) { #>
647 <span class="jltma-dual-heading-icon"><i class="{{ settings.ma_el_dual_heading_icon.value }}"></i></span>
648 <# } #>
649 <# var dhTitleTag = settings.title_html_tag || 'h1'; #>
650 <{{ dhTitleTag }} class="jltma-dual-heading-title">
651 <#
652 var dhLink = settings.ma_el_dual_heading_title_link || {};
653 var dhAttrs = '';
654 if ( dhLink.is_external ) { dhAttrs += ' target="_blank"'; }
655 if ( dhLink.nofollow ) { dhAttrs += ' rel="nofollow"'; }
656 if ( dhLink.custom_attributes ) {
657 dhLink.custom_attributes.split( ',' ).forEach( function( pair ) {
658 var kv = pair.split( '|' );
659 var key = ( kv[0] || '' ).trim().replace( /[^a-zA-Z0-9_-]/g, '' );
660 var val = ( kv[1] || '' ).trim();
661 if ( key ) { dhAttrs += ' ' + key + '="' + val + '"'; }
662 } );
663 }
664 #>
665 <# if ( dhLink.url ) { #>
666 <a href="{{ dhLink.url }}"{{{ dhAttrs }}}>
667 <# } #>
668 <span class="jltma-first-heading">{{{ settings.ma_el_dual_first_heading }}}</span><span class="jltma-second-heading">{{{ settings.ma_el_dual_second_heading }}}</span>
669 <# if ( dhLink.url ) { #>
670 </a>
671 <# } #>
672 </{{ dhTitleTag }}>
673 <# if ( settings.ma_el_dual_heading_description !="" ) { #>
674 <p class="jltma-dual-heading-description">{{{ settings.ma_el_dual_heading_description }}}</p>
675 <# } #>
676 </div>
677 </div>
678 <# } #>
679
680 <?php
681 }
682 }
683