PluginProbe ʕ •ᴥ•ʔ
Shortcodes and extra features for Phlox theme / 2.17.4
Shortcodes and extra features for Phlox theme v2.17.4
2.17.21 2.17.20 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.6 1.0.9 1.1.0 1.3.0 1.3.1 1.3.10 1.3.14 1.3.2 1.3.3 1.3.6 1.4.0 1.4.1 1.4.2 1.5.0 1.5.2 1.6.0 1.6.2 1.6.4 1.7.0 1.7.2 2.10.0 2.10.1 2.10.3 2.10.5 2.10.7 2.10.8 2.10.9 2.11.0 2.11.1 2.11.2 2.12.0 2.14.0 2.15.0 2.15.2 2.15.4 2.15.5 2.15.6 2.15.7 2.15.8 2.15.9 2.16.0 2.16.1 2.16.2 2.16.3 2.16.4 2.17.0 2.17.1 2.17.12 2.17.13 2.17.14 2.17.15 2.17.16 2.17.2 2.17.3 2.17.4 2.17.5 2.17.6 2.17.8 2.17.9 2.4.12 2.4.13 2.4.14 2.4.16 2.4.18 2.4.19 2.4.9 2.5.0 2.5.1 2.5.10 2.5.11 2.5.12 2.5.13 2.5.14 2.5.15 2.5.16 2.5.17 2.5.19 2.5.2 2.5.20 2.5.3 2.5.7 2.5.8 2.5.9 2.6.0 2.6.1 2.6.10 2.6.12 2.6.13 2.6.14 2.6.15 2.6.16 2.6.17 2.6.19 2.6.2 2.6.20 2.6.4 2.6.5 2.6.7 2.7.0 2.7.1 2.7.10 2.7.11 2.7.12 2.7.13 2.7.14 2.7.2 2.7.3 2.7.4 2.7.5 2.7.6 2.7.7 2.7.8 2.7.9 2.8.0 2.8.1 2.8.2 2.8.3 2.8.4 2.8.5 2.8.6 2.8.7 2.8.9 2.9.0 2.9.12 2.9.14 2.9.15 2.9.16 2.9.17 2.9.18 2.9.19 2.9.2 2.9.20 2.9.21 2.9.22 2.9.3 2.9.4 2.9.5 2.9.6 2.9.7 2.9.8
auxin-elements / includes / elementor / widgets / heading-modern.php
auxin-elements / includes / elementor / widgets Last commit date
theme-elements 1 year ago accordion.php 1 year ago audio.php 4 years ago before-after.php 3 years ago button.php 1 year ago carousel-navigation.php 4 years ago circle-chart.php 1 year ago contact-box.php 4 years ago contact-form.php 1 year ago custom-list.php 1 year ago divider.php 4 years ago gallery.php 1 year ago gmap.php 4 years ago heading-modern.php 1 year ago icon.php 1 year ago image.php 1 year ago mailchimp.php 1 year ago modern-button.php 1 year ago products-grid.php 1 year ago quote.php 1 year ago recent-comments.php 1 year ago recent-posts-grid-carousel.php 1 year ago recent-posts-land-style.php 1 year ago recent-posts-masonry.php 1 year ago recent-posts-tiles-carousel.php 1 year ago recent-posts-tiles.php 1 year ago recent-posts-timeline.php 1 year ago recent-products.php 1 year ago responsive-table.php 1 year ago search.php 4 years ago staff.php 1 year ago svg.php 1 year ago tabs.php 1 year ago testimonial.php 1 year ago text.php 1 year ago touch-slider.php 1 year ago video.php 4 years ago
heading-modern.php
1256 lines
1 <?php
2 namespace Auxin\Plugin\CoreElements\Elementor\Elements;
3
4 use Elementor\Plugin;
5 use Elementor\Widget_Base;
6 use Elementor\Controls_Manager;
7 use Elementor\Group_Control_Typography;
8 use Elementor\Group_Control_Text_Stroke;
9 use Elementor\Core\Kits\Documents\Tabs\Global_Typography;
10 use Elementor\Group_Control_Box_Shadow;
11 use Elementor\Group_Control_Text_Shadow;
12 use Elementor\Group_Control_Background;
13
14
15 if ( ! defined( 'ABSPATH' ) ) {
16 exit; // Exit if accessed directly.
17 }
18
19 /**
20 * Elementor 'ModernHeading' widget.
21 *
22 * Elementor widget that displays an 'ModernHeading' with lightbox.
23 *
24 * @since 1.0.0
25 */
26 class ModernHeading extends Widget_Base {
27
28 /**
29 * Get widget name.
30 *
31 * Retrieve 'ModernHeading' widget name.
32 *
33 * @since 1.0.0
34 * @access public
35 *
36 * @return string Widget name.
37 */
38 public function get_name() {
39 return 'aux_modern_heading';
40 }
41
42 /**
43 * Get widget title.
44 *
45 * Retrieve 'ModernHeading' widget title.
46 *
47 * @since 1.0.0
48 * @access public
49 *
50 * @return string Widget title.
51 */
52 public function get_title() {
53 return __('Modern Heading', 'auxin-elements' );
54 }
55
56 /**
57 * Get widget icon.
58 *
59 * Retrieve 'ModernHeading' widget icon.
60 *
61 * @since 1.0.0
62 * @access public
63 *
64 * @return string Widget icon.
65 */
66 public function get_icon() {
67 return 'eicon-heading auxin-badge';
68 }
69
70 /**
71 * Get widget categories.
72 *
73 * Retrieve 'ModernHeading' widget icon.
74 *
75 * @since 1.0.0
76 * @access public
77 *
78 * @return string Widget icon.
79 */
80 public function get_categories() {
81 return array( 'auxin-core' );
82 }
83
84 /**
85 * Register 'ModernHeading' widget controls.
86 *
87 * Adds different input fields to allow the user to change and customize the widget settings.
88 *
89 * @since 1.0.0
90 * @access protected
91 */
92 protected function register_controls() {
93
94 /*-----------------------------------------------------------------------------------*/
95 /* Content TAB
96 /*-----------------------------------------------------------------------------------*/
97
98 $this->start_controls_section(
99 'title_section',
100 array(
101 'label' => __('Heading', 'auxin-elements' ),
102 )
103 );
104
105 $this->add_control(
106 'title',
107 array(
108 'label' => __( 'Title', 'auxin-elements' ),
109 'type' => Controls_Manager::TEXTAREA,
110 'dynamic' => array(
111 'active' => true
112 ),
113 'default' => __( 'Add your heading text here ..', 'auxin-elements' ),
114 'label_block' => true
115 )
116 );
117
118 $this->add_control(
119 'link',
120 array(
121 'label' => __('Link','auxin-elements' ),
122 'type' => Controls_Manager::URL,
123 'placeholder' => 'http://your-link.com',
124 'show_external' => true,
125 'label_block' => true,
126 'dynamic' => array(
127 'active' => true
128 )
129 )
130 );
131
132 $this->add_control(
133 'title_tag',
134 array(
135 'label' => __( 'HTML Tag', 'auxin-elements' ),
136 'type' => Controls_Manager::SELECT,
137 'options' => array(
138 'h1' => 'H1',
139 'h2' => 'H2',
140 'h3' => 'H3',
141 'h4' => 'H4',
142 'h5' => 'H5',
143 'h6' => 'H6',
144 'div' => 'div',
145 'span' => 'span',
146 'p' => 'p'
147 ),
148 'default' => 'h2',
149 )
150 );
151
152 $this->add_responsive_control(
153 'alignment',
154 array(
155 'label' => __('Alignment', 'auxin-elements'),
156 'type' => Controls_Manager::CHOOSE,
157 'default' => '',
158 'options' => array(
159 'left' => array(
160 'title' => __( 'Left', 'auxin-elements' ),
161 'icon' => 'eicon-text-align-left',
162 ),
163 'center' => array(
164 'title' => __( 'Center', 'auxin-elements' ),
165 'icon' => 'eicon-text-align-center',
166 ),
167 'right' => array(
168 'title' => __( 'Right', 'auxin-elements' ),
169 'icon' => 'eicon-text-align-right',
170 )
171 ),
172 'selectors_dictionary' => [
173 'left' => '',
174 'center' => 'text-align:center;margin-left:auto !important;margin-right:auto !important;',
175 'right' => 'text-align:right;margin-left:auto !important;'
176 ],
177 'selectors' => [
178 '{{WRAPPER}} .aux-widget-inner > *' => '{{VALUE}}'
179 ]
180 )
181 );
182
183 /* Divider
184 /*-------------------------------------*/
185
186 $this->add_control(
187 'divider',
188 array(
189 'label' => __( 'Display Divider', 'auxin-elements' ),
190 'type' => Controls_Manager::SWITCHER,
191 'label_on' => __( 'On', 'auxin-elements' ),
192 'label_off' => __( 'Off', 'auxin-elements' ),
193 'return_value' => 'yes',
194 'default' => 'yes',
195 'separator' => 'before'
196 )
197 );
198
199 $this->add_control(
200 'divider_position',
201 array(
202 'label' => __( 'Divider Position', 'auxin-elements' ),
203 'type' => Controls_Manager::SELECT,
204 'options' => array(
205 'before' => __( 'Before Heading', 'auxin-elements' ),
206 'between' => __( 'Between Headings', 'auxin-elements' ),
207 'after' => __( 'After Headings', 'auxin-elements' )
208 ),
209 'default' => 'after',
210 'condition' => array(
211 'divider' => 'yes'
212 )
213 )
214 );
215
216 $this->end_controls_section();
217
218
219 /* Secondary heading
220 /*-------------------------------------*/
221
222 $this->start_controls_section(
223 'title_secondary_section',
224 array(
225 'label' => __('Secondary Heading', 'auxin-elements' ),
226 )
227 );
228
229 $this->add_control(
230 'title_secondary_before',
231 array(
232 'label' => __( 'Before Text', 'auxin-elements' ),
233 'type' => Controls_Manager::TEXT,
234 'dynamic' => array(
235 'active' => true
236 ),
237 'default' => '',
238 'label_block' => true
239 )
240 );
241
242 $this->add_control(
243 'title_secondary_highlight',
244 array(
245 'label' => __( 'Highlighted Text', 'auxin-elements' ),
246 'type' => Controls_Manager::TEXT,
247 'dynamic' => array(
248 'active' => true
249 ),
250 'default' => '',
251 'label_block' => true
252 )
253 );
254
255 $this->add_control(
256 'title_secondary_after',
257 array(
258 'label' => __( 'After Text', 'auxin-elements' ),
259 'type' => Controls_Manager::TEXT,
260 'dynamic' => array(
261 'active' => true
262 ),
263 'default' => '',
264 'label_block' => true
265 )
266 );
267
268 $this->add_control(
269 'link_secondary',
270 array(
271 'label' => __('Link','auxin-elements' ),
272 'type' => Controls_Manager::URL,
273 'placeholder' => 'http://your-link.com',
274 'show_external' => true,
275 'label_block' => true,
276 'dynamic' => array(
277 'active' => true
278 )
279 )
280 );
281
282 $this->add_control(
283 'title_tag_secondary',
284 array(
285 'label' => __( 'HTML Tag', 'auxin-elements' ),
286 'type' => Controls_Manager::SELECT,
287 'options' => array(
288 'h1' => 'H1',
289 'h2' => 'H2',
290 'h3' => 'H3',
291 'h4' => 'H4',
292 'h5' => 'H5',
293 'h6' => 'H6',
294 'div' => 'div',
295 'span' => 'span',
296 'p' => 'p'
297 ),
298 'default' => 'h3'
299 )
300 );
301
302 $this->end_controls_section();
303
304 /* Description
305 /*-------------------------------------*/
306
307 $this->start_controls_section(
308 'description_primary_section',
309 array(
310 'label' => __('Description', 'auxin-elements' ),
311 )
312 );
313
314 $this->add_control(
315 'description',
316 array(
317 'label' => __( 'Description', 'auxin-elements' ),
318 'type' => Controls_Manager::WYSIWYG,
319 'dynamic' => array(
320 'active' => true
321 ),
322 'label_block' => true,
323 'separator' => 'before'
324 )
325 );
326
327 $this->end_controls_section();
328
329
330 /*-----------------------------------------------------------------------------------*/
331 /* Style TAB
332 /*-----------------------------------------------------------------------------------*/
333
334 /* Title Section
335 /*-------------------------------------*/
336
337 $this->start_controls_section(
338 'title_style_section',
339 array(
340 'label' => __( 'Heading', 'auxin-elements' ),
341 'tab' => Controls_Manager::TAB_STYLE,
342 'condition' => ['title!' => '']
343 )
344 );
345
346 $this->add_group_control(
347 Group_Control_Typography::get_type(),
348 array(
349 'name' => 'title_typography',
350 'global' => [
351 'default' => Global_Typography::TYPOGRAPHY_PRIMARY,
352 ],
353 'selector' => '{{WRAPPER}} .aux-modern-heading-primary'
354 )
355 );
356
357 if ( class_exists( 'Elementor\Group_Control_Text_Stroke' ) ) {
358 $this->add_group_control(
359 Group_Control_Text_Stroke::get_type(),
360 [
361 'name' => 'title_stroke',
362 'selector' => '{{WRAPPER}} .aux-modern-heading-primary'
363 ]
364 );
365 }
366
367 $this->start_controls_tabs( 'title_tabs' );
368
369 $this->start_controls_tab(
370 'title_tab_normal_state',
371 [
372 'label' => __( 'Normal', 'auxin-elements' ),
373 ]
374 );
375
376 $this->add_responsive_control(
377 'title_color',
378 array(
379 'label' => __( 'Color', 'auxin-elements' ),
380 'type' => Controls_Manager::COLOR,
381 'selectors' => array(
382 '{{WRAPPER}} .aux-modern-heading-primary' => 'color: {{VALUE}};'
383 )
384 )
385 );
386
387 $this->add_group_control(
388 Group_Control_Text_Shadow::get_type(),
389 [
390 'name' => 'title_text_shadow',
391 'label' => __( 'Text Shadow', 'auxin-elements' ),
392 'selector' => '{{WRAPPER}} .aux-modern-heading-primary'
393 ]
394 );
395
396 $this->add_group_control(
397 Group_Control_Background::get_type(),
398 [
399 'name' => 'title_background',
400 'selector' => '{{WRAPPER}} .aux-modern-heading-primary',
401 'types' => [ 'classic', 'gradient']
402 ]
403 );
404
405 $this->end_controls_tab();
406
407 $this->start_controls_tab(
408 'title_tab_hover_state',
409 [
410 'label' => __( 'Hover', 'auxin-elements' ),
411 ]
412 );
413
414 $this->add_responsive_control(
415 'title_hover_color',
416 array(
417 'label' => __( 'Color', 'auxin-elements' ),
418 'type' => Controls_Manager::COLOR,
419 'selectors' => array(
420 '{{WRAPPER}} .aux-modern-heading-primary:hover' => 'color: {{VALUE}};',
421 ),
422 )
423 );
424
425 $this->add_group_control(
426 Group_Control_Text_Shadow::get_type(),
427 [
428 'name' => 'title_hover_text_shadow',
429 'label' => __( 'Text Shadow', 'auxin-elements' ),
430 'selector' => '{{WRAPPER}} .aux-modern-heading-primary:hover'
431 ]
432 );
433
434 $this->add_group_control(
435 Group_Control_Background::get_type(),
436 [
437 'name' => 'title_hover_background',
438 'selector' => '{{WRAPPER}} .aux-modern-heading-primary:hover',
439 'types' => [ 'classic', 'gradient']
440 ]
441 );
442
443 $this->end_controls_tab();
444
445 $this->end_controls_tabs();
446
447 $this->add_responsive_control(
448 'title_margin',
449 [
450 'label' => __( 'Margin', 'auxin-elements' ),
451 'type' => Controls_Manager::DIMENSIONS,
452 'size_units' => [ 'px', 'em', '%' ],
453 'selectors' => [
454 '{{WRAPPER}} .aux-modern-heading-primary' => 'margin:{{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
455 ],
456 'separator' => 'before'
457 ]
458 );
459
460 $this->add_responsive_control(
461 'title_padding',
462 [
463 'label' => __( 'Padding', 'auxin-elements' ),
464 'type' => Controls_Manager::DIMENSIONS,
465 'size_units' => [ 'px', 'em', '%' ],
466 'selectors' => [
467 '{{WRAPPER}} .aux-modern-heading-primary' => 'padding:{{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
468 ]
469 ]
470 );
471
472 $this->add_responsive_control(
473 'title_border_radius',
474 [
475 'label' => __( 'Border radius', 'auxin-elements' ),
476 'type' => Controls_Manager::DIMENSIONS,
477 'size_units' => [ 'px', 'em', '%' ],
478 'allowed_dimensions' => 'all',
479 'selectors' => [
480 '{{WRAPPER}} .aux-modern-heading-primary' => 'border-radius:{{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
481 ]
482 ]
483 );
484
485 $this->add_responsive_control(
486 'title_width',
487 array(
488 'label' => __('Max Width','auxin-elements' ),
489 'type' => Controls_Manager::SLIDER,
490 'size_units' => array('px', 'em','%'),
491 'range' => array(
492 '%' => array(
493 'min' => 1,
494 'max' => 100,
495 'step' => 1
496 ),
497 'em' => array(
498 'min' => 1,
499 'max' => 100,
500 'step' => 1
501 ),
502 'px' => array(
503 'min' => 1,
504 'max' => 1600,
505 'step' => 1
506 )
507 ),
508 'selectors' => array(
509 '{{WRAPPER}} .aux-modern-heading-primary' => 'max-width:{{SIZE}}{{UNIT}};'
510 )
511 )
512 );
513
514 $this->end_controls_section();
515
516 /* Secondary title Section
517 /*-------------------------------------*/
518
519 $this->start_controls_section(
520 'title2_style_heading',
521 [
522 'label' => __( 'Secondary Heading', 'auxin-elements' ),
523 'tab' => Controls_Manager::TAB_STYLE,
524
525 'conditions' =>
526 [
527 'relation' => 'or',
528 'terms' => [
529 [
530 'name' => 'title_secondary_before',
531 'operator' => '!==',
532 'value' => '',
533 ], [
534 'name' => 'title_secondary_after',
535 'operator' => '!==',
536 'value' => '',
537 ]
538 ]
539 ]
540 ]
541 );
542
543 $this->add_group_control(
544 Group_Control_Typography::get_type(),
545 array(
546 'name' => 'title2_typography',
547 'global' => [
548 'default' => Global_Typography::TYPOGRAPHY_PRIMARY,
549 ],
550 'selector' => '{{WRAPPER}} .aux-modern-heading-secondary'
551 )
552 );
553
554 $this->start_controls_tabs( 'title2_tabs' );
555
556 $this->start_controls_tab(
557 'title2_tab_normal_state',
558 [
559 'label' => __( 'Normal', 'auxin-elements' ),
560 ]
561 );
562
563 $this->add_responsive_control(
564 'title2_color',
565 array(
566 'label' => __( 'Color', 'auxin-elements' ),
567 'type' => Controls_Manager::COLOR,
568 'selectors' => array(
569 '{{WRAPPER}} .aux-modern-heading-secondary' => 'color: {{VALUE}};'
570 )
571 )
572 );
573
574 $this->add_group_control(
575 Group_Control_Text_Shadow::get_type(),
576 [
577 'name' => 'title2_text_shadow',
578 'label' => __( 'Text Shadow', 'auxin-elements' ),
579 'selector' => '{{WRAPPER}} .aux-modern-heading-secondary'
580 ]
581 );
582
583 $this->add_group_control(
584 Group_Control_Background::get_type(),
585 [
586 'name' => 'title2_background',
587 'selector' => '{{WRAPPER}} .aux-modern-heading-secondary',
588 'types' => [ 'classic', 'gradient']
589 ]
590 );
591
592 $this->end_controls_tab();
593
594 $this->start_controls_tab(
595 'title2_tab_hover_state',
596 [
597 'label' => __( 'Hover', 'auxin-elements' ),
598 ]
599 );
600
601 $this->add_responsive_control(
602 'title2_hover_color',
603 array(
604 'label' => __( 'Color', 'auxin-elements' ),
605 'type' => Controls_Manager::COLOR,
606 'selectors' => array(
607 '{{WRAPPER}} .aux-modern-heading-secondary:hover' => 'color: {{VALUE}};',
608 ),
609 )
610 );
611
612 $this->add_group_control(
613 Group_Control_Text_Shadow::get_type(),
614 [
615 'name' => 'title2_hover_text_shadow',
616 'label' => __( 'Text Shadow', 'auxin-elements' ),
617 'selector' => '{{WRAPPER}} .aux-modern-heading-secondary:hover'
618 ]
619 );
620
621 $this->add_group_control(
622 Group_Control_Background::get_type(),
623 [
624 'name' => 'title2_hover_background',
625 'selector' => '{{WRAPPER}} .aux-modern-heading-secondary:hover',
626 'types' => [ 'classic', 'gradient']
627 ]
628 );
629
630 $this->end_controls_tab();
631
632 $this->end_controls_tabs();
633
634 $this->add_responsive_control(
635 'title2_margin',
636 [
637 'label' => __( 'Margin', 'auxin-elements' ),
638 'type' => Controls_Manager::DIMENSIONS,
639 'size_units' => [ 'px', 'em', '%' ],
640 'selectors' => [
641 '{{WRAPPER}} .aux-modern-heading-secondary' => 'margin:{{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
642 ],
643 'separator' => 'before'
644 ]
645 );
646
647 $this->add_responsive_control(
648 'title2_padding',
649 [
650 'label' => __( 'Padding', 'auxin-elements' ),
651 'type' => Controls_Manager::DIMENSIONS,
652 'size_units' => [ 'px', 'em', '%' ],
653 'selectors' => [
654 '{{WRAPPER}} .aux-modern-heading-secondary' => 'padding:{{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
655 ]
656 ]
657 );
658
659 $this->add_responsive_control(
660 'title2_border_radius',
661 [
662 'label' => __( 'Border radius', 'auxin-elements' ),
663 'type' => Controls_Manager::DIMENSIONS,
664 'size_units' => [ 'px', 'em', '%' ],
665 'allowed_dimensions' => 'all',
666 'selectors' => [
667 '{{WRAPPER}} .aux-modern-heading-secondary' => 'border-radius:{{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
668 ]
669 ]
670 );
671
672 $this->add_responsive_control(
673 'title2_width',
674 array(
675 'label' => __('Max Width','auxin-elements' ),
676 'type' => Controls_Manager::SLIDER,
677 'size_units' => array('px', 'em','%'),
678 'range' => array(
679 '%' => array(
680 'min' => 1,
681 'max' => 100,
682 'step' => 1
683 ),
684 'em' => array(
685 'min' => 1,
686 'max' => 100,
687 'step' => 1
688 ),
689 'px' => array(
690 'min' => 1,
691 'max' => 1600,
692 'step' => 1
693 )
694 ),
695 'selectors' => array(
696 '{{WRAPPER}} .aux-modern-heading-secondary' => 'max-width:{{SIZE}}{{UNIT}};'
697 )
698 )
699 );
700
701 $this->end_controls_section();
702
703
704 /* Secondary Highlighted Style
705 /*-------------------------------------*/
706
707 $this->start_controls_section(
708 'title2_highlighted_style_heading',
709 [
710 'label' => __( 'Secondary Heading - Highlighted', 'auxin-elements' ),
711 'tab' => Controls_Manager::TAB_STYLE,
712 'condition' => [ 'title_secondary_highlight!' => '' ]
713 ]
714 );
715
716 $this->add_group_control(
717 Group_Control_Typography::get_type(),
718 array(
719 'name' => 'title2_highlighted_typography',
720 'global' => [
721 'default' => Global_Typography::TYPOGRAPHY_PRIMARY,
722 ],
723 'selector' => '{{WRAPPER}} .aux-modern-heading-secondary .aux-head-highlight'
724 )
725 );
726
727 $this->start_controls_tabs( 'title2_highlighted_tabs' );
728
729 $this->start_controls_tab(
730 'title2_highlighted_tab_normal_state',
731 [
732 'label' => __( 'Normal', 'auxin-elements' ),
733 ]
734 );
735
736 $this->add_responsive_control(
737 'title2_highlighted_color',
738 array(
739 'label' => __( 'Color', 'auxin-elements' ),
740 'type' => Controls_Manager::COLOR,
741 'selectors' => array(
742 '{{WRAPPER}} .aux-modern-heading-secondary .aux-head-highlight' => 'color: {{VALUE}};'
743 )
744 )
745 );
746
747 $this->add_group_control(
748 Group_Control_Text_Shadow::get_type(),
749 [
750 'name' => 'title2_highlighted_text_shadow',
751 'label' => __( 'Text Shadow', 'auxin-elements' ),
752 'selector' => '{{WRAPPER}} .aux-modern-heading-secondary .aux-head-highlight'
753 ]
754 );
755
756 $this->add_group_control(
757 Group_Control_Background::get_type(),
758 [
759 'name' => 'title2_highlighted_background',
760 'selector' => '{{WRAPPER}} .aux-modern-heading-secondary .aux-head-highlight',
761 'types' => [ 'classic', 'gradient']
762 ]
763 );
764
765 $this->end_controls_tab();
766
767 $this->start_controls_tab(
768 'title2_highlighted_tab_hover_state',
769 [
770 'label' => __( 'Hover', 'auxin-elements' ),
771 ]
772 );
773
774 $this->add_responsive_control(
775 'title2_highlighted_hover_color',
776 array(
777 'label' => __( 'Color', 'auxin-elements' ),
778 'type' => Controls_Manager::COLOR,
779 'selectors' => array(
780 '{{WRAPPER}} .aux-modern-heading-secondary .aux-head-highlight:hover' => 'color: {{VALUE}};',
781 ),
782 )
783 );
784
785 $this->add_group_control(
786 Group_Control_Text_Shadow::get_type(),
787 [
788 'name' => 'title2_highlighted_hover_text_shadow',
789 'label' => __( 'Text Shadow', 'auxin-elements' ),
790 'selector' => '{{WRAPPER}} .aux-modern-heading-secondary .aux-head-highlight:hover'
791 ]
792 );
793
794 $this->add_group_control(
795 Group_Control_Background::get_type(),
796 [
797 'name' => 'title2_highlighted_hover_background',
798 'selector' => '{{WRAPPER}} .aux-modern-heading-secondary .aux-head-highlight:hover',
799 'types' => [ 'classic', 'gradient']
800 ]
801 );
802
803 $this->end_controls_tab();
804
805 $this->end_controls_tabs();
806
807 $this->add_responsive_control(
808 'title2_highlighted_margin',
809 [
810 'label' => __( 'Margin', 'auxin-elements' ),
811 'type' => Controls_Manager::DIMENSIONS,
812 'size_units' => [ 'px', 'em', '%' ],
813 'selectors' => [
814 '{{WRAPPER}} .aux-modern-heading-secondary .aux-head-highlight' => 'margin:{{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
815 ],
816 'separator' => 'before'
817 ]
818 );
819
820 $this->add_responsive_control(
821 'title2_highlighted_padding',
822 [
823 'label' => __( 'Padding', 'auxin-elements' ),
824 'type' => Controls_Manager::DIMENSIONS,
825 'size_units' => [ 'px', 'em', '%' ],
826 'selectors' => [
827 '{{WRAPPER}} .aux-modern-heading-secondary .aux-head-highlight' => 'padding:{{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
828 ]
829 ]
830 );
831
832 $this->add_responsive_control(
833 'title2_highlighted_border_radius',
834 [
835 'label' => __( 'Border radius', 'auxin-elements' ),
836 'type' => Controls_Manager::DIMENSIONS,
837 'size_units' => [ 'px', 'em', '%' ],
838 'allowed_dimensions' => 'all',
839 'selectors' => [
840 '{{WRAPPER}} .aux-modern-heading-secondary .aux-head-highlight' => 'border-radius:{{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
841 ]
842 ]
843 );
844
845 $this->add_responsive_control(
846 'title2_highlighted_width',
847 array(
848 'label' => __('Max Width','auxin-elements' ),
849 'type' => Controls_Manager::SLIDER,
850 'size_units' => array('px', 'em','%'),
851 'range' => array(
852 '%' => array(
853 'min' => 1,
854 'max' => 100,
855 'step' => 1
856 ),
857 'em' => array(
858 'min' => 1,
859 'max' => 100,
860 'step' => 1
861 ),
862 'px' => array(
863 'min' => 1,
864 'max' => 1600,
865 'step' => 1
866 )
867 ),
868 'selectors' => array(
869 '{{WRAPPER}} .aux-modern-heading-secondary .aux-head-highlight' => 'max-width:{{SIZE}}{{UNIT}};'
870 )
871 )
872 );
873
874 $this->end_controls_section();
875
876 /* Divider Section
877 /*-------------------------------------*/
878
879 $this->start_controls_section(
880 'divider_style_section',
881 [
882 'label' => __( 'Divider', 'auxin-elements' ),
883 'tab' => Controls_Manager::TAB_STYLE,
884 'condition' => [
885 'divider' => 'yes'
886 ]
887 ]
888 );
889
890 $this->add_responsive_control(
891 'divider_weight',
892 array(
893 'label' => __( 'Weight', 'auxin-elements' ),
894 'type' => Controls_Manager::SLIDER,
895 'size_units' => array( 'px' ),
896 'range' => array(
897 'px' => array(
898 'max' => 10
899 )
900 ),
901 'selectors' => array(
902 '{{WRAPPER}} .aux-modern-heading-divider' => 'height: {{SIZE}}{{UNIT}};'
903 )
904 )
905 );
906
907 $this->add_responsive_control(
908 'divider_width',
909 array(
910 'label' => __( 'Width', 'auxin-elements' ),
911 'type' => Controls_Manager::SLIDER,
912 'size_units' => array( 'px', '%' ),
913 'range' => array(
914 'px' => array(
915 'min' => 1,
916 'max' => 1200
917 ),
918 '%' => array(
919 'min' => 1,
920 'max' => 100
921 )
922 ),
923 'selectors' => array(
924 '{{WRAPPER}} .aux-modern-heading-divider' => 'width: {{SIZE}}{{UNIT}};'
925 )
926 )
927 );
928
929 $this->add_responsive_control(
930 'divider_margin',
931 array(
932 'label' => __( 'Margin', 'auxin-elements' ),
933 'type' => Controls_Manager::DIMENSIONS,
934 'size_units' => array( 'px', 'em' ),
935 'allowed_dimensions' => 'all',
936 'selectors' => array(
937 '{{WRAPPER}} .aux-modern-heading-divider' => 'margin:{{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
938 )
939 )
940 );
941
942 $this->add_responsive_control(
943 'divider_color',
944 array(
945 'label' => __( 'Color', 'auxin-elements' ),
946 'type' => Controls_Manager::COLOR,
947 'selectors' => array(
948 '{{WRAPPER}} .aux-modern-heading-divider' => 'background-color: {{VALUE}};'
949 )
950 )
951 );
952
953 $this->add_group_control(
954 Group_Control_Box_Shadow::get_type(),
955 array(
956 'name' => 'divider_shadow',
957 'selector' => '{{WRAPPER}} .aux-modern-heading-divider',
958 'separator' => 'before'
959 )
960 );
961
962 $this->add_group_control(
963 Group_Control_Background::get_type(),
964 array(
965 'name' => 'divider_backgoundcolor',
966 'label' => __( 'Background', 'auxin-elements' ),
967 'selector' => '{{WRAPPER}} .aux-modern-heading-divider'
968 )
969 );
970
971 $this->end_controls_section();
972
973 /* Description Section
974 /*-------------------------------------*/
975
976 $this->start_controls_section(
977 'description_style_section',
978 array(
979 'label' => __( 'Description', 'auxin-elements' ),
980 'tab' => Controls_Manager::TAB_STYLE,
981 'condition' => [ 'description!' => '' ]
982 )
983 );
984
985 $this->add_responsive_control(
986 'description_color',
987 array(
988 'label' => __( 'Color', 'auxin-elements' ),
989 'type' => Controls_Manager::COLOR,
990 'selectors' => array(
991 '{{WRAPPER}} .aux-modern-heading-description' => 'color: {{VALUE}};'
992 )
993 )
994 );
995
996 $this->add_group_control(
997 Group_Control_Typography::get_type(),
998 array(
999 'name' => 'description_typography',
1000 'global' => [
1001 'default' => Global_Typography::TYPOGRAPHY_PRIMARY,
1002 ],
1003 'selector' => '{{WRAPPER}} .aux-modern-heading-description'
1004 )
1005 );
1006
1007 $this->add_responsive_control(
1008 'description_margin',
1009 array(
1010 'label' => __( 'Margin', 'auxin-elements' ),
1011 'type' => Controls_Manager::DIMENSIONS,
1012 'size_units' => array( 'px', 'em' ),
1013 'allowed_dimensions' => 'all',
1014 'selectors' => array(
1015 '{{WRAPPER}} .aux-modern-heading-description' => 'margin:{{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
1016 )
1017 )
1018 );
1019
1020 $this->add_responsive_control(
1021 'description_width',
1022 array(
1023 'label' => __('Max Width','auxin-elements' ),
1024 'type' => Controls_Manager::SLIDER,
1025 'size_units' => array('px', 'em','%'),
1026 'range' => array(
1027 '%' => array(
1028 'min' => 1,
1029 'max' => 100,
1030 'step' => 1
1031 ),
1032 'em' => array(
1033 'min' => 1,
1034 'max' => 100,
1035 'step' => 1
1036 ),
1037 'px' => array(
1038 'min' => 1,
1039 'max' => 1600,
1040 'step' => 1
1041 )
1042 ),
1043 'selectors' => array(
1044 '{{WRAPPER}} .aux-modern-heading-description' => 'max-width:{{SIZE}}{{UNIT}};'
1045 )
1046 )
1047 );
1048
1049 $this->end_controls_section();
1050
1051 /* Wrapper Section
1052 /*-------------------------------------*/
1053
1054 $this->start_controls_section(
1055 'wrapper_style_section',
1056 array(
1057 'label' => __( 'Wrapper', 'auxin-elements' ),
1058 'tab' => Controls_Manager::TAB_STYLE
1059 )
1060 );
1061
1062 $this->add_responsive_control(
1063 'width',
1064 array(
1065 'label' => __('Width','auxin-elements' ),
1066 'type' => Controls_Manager::SLIDER,
1067 'size_units' => array('px', 'em','%', 'vw'),
1068 'range' => array(
1069 '%' => array(
1070 'min' => 1,
1071 'max' => 100,
1072 'step' => 1
1073 ),
1074 'em' => array(
1075 'min' => 1,
1076 'max' => 100,
1077 'step' => 1
1078 ),
1079 'px' => array(
1080 'min' => 1,
1081 'max' => 1600,
1082 'step' => 1
1083 )
1084 ),
1085 'selectors' => array(
1086 '{{WRAPPER}} .aux-widget-modern-heading .aux-widget-inner' => 'width:{{SIZE}}{{UNIT}};'
1087 )
1088 )
1089 );
1090
1091 $this->add_responsive_control(
1092 'height',
1093 array(
1094 'label' => __('Height','auxin-elements' ),
1095 'type' => Controls_Manager::SLIDER,
1096 'size_units' => array('px', 'em', '%', 'vh'),
1097 'range' => array(
1098 '%' => array(
1099 'min' => 1,
1100 'max' => 100,
1101 'step' => 1
1102 ),
1103 'em' => array(
1104 'min' => 1,
1105 'max' => 100,
1106 'step' => 1
1107 ),
1108 'px' => array(
1109 'min' => 1,
1110 'max' => 1600,
1111 'step' => 1
1112 )
1113
1114 ),
1115 'selectors' => array(
1116 '{{WRAPPER}} .aux-widget-modern-heading .aux-widget-inner' => 'height:{{SIZE}}{{UNIT}};'
1117 )
1118 )
1119 );
1120
1121 $this->add_responsive_control(
1122 'wrapper_margin',
1123 array(
1124 'label' => __( 'Margin', 'auxin-elements' ),
1125 'type' => Controls_Manager::DIMENSIONS,
1126 'size_units' => array( 'px', 'em'),
1127 'allowed_dimensions' => 'all',
1128 'selectors' => array(
1129 '{{WRAPPER}} .aux-widget-modern-heading .aux-widget-inner' => 'margin:{{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
1130 )
1131 )
1132 );
1133
1134 $this->add_responsive_control(
1135 'wrapper_padding',
1136 array(
1137 'label' => __( 'Padding', 'auxin-elements' ),
1138 'type' => Controls_Manager::DIMENSIONS,
1139 'size_units' => array( 'px', 'em', '%'),
1140 'allowed_dimensions' => 'all',
1141 'selectors' => array(
1142 '{{WRAPPER}} .aux-widget-modern-heading .aux-widget-inner' => 'padding:{{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
1143 )
1144 )
1145 );
1146
1147 $this->end_controls_section();
1148 }
1149
1150 /**
1151 * Render 'ModernHeading' widget output on the frontend.
1152 *
1153 * Written in PHP and used to generate the final HTML.
1154 *
1155 * @since 1.0.0
1156 * @access protected
1157 */
1158 protected function render() {
1159
1160 $settings = $this->get_settings_for_display();
1161
1162 $divider_markup = auxin_is_true( $settings['divider'] ) ? '<div class="aux-modern-heading-divider"></div>' : '';
1163
1164 echo '<section class="aux-widget-modern-heading">
1165 <div class="aux-widget-inner">';
1166
1167 // Maybe print divider before
1168 if( empty( $settings['divider_position'] ) || 'before' == $settings['divider_position'] ){
1169 echo wp_kses_post( $divider_markup );
1170 }
1171
1172 // Print Primary Heading
1173 if( ! empty( $settings['link']['url'] ) ){
1174
1175 // Make Link attributes
1176 $this->add_render_attribute( 'link-primary', 'href', esc_url( $settings['link']['url'] ) );
1177 $this->add_render_attribute( 'link-primary', 'class', 'aux-modern-heading-primary-link' );
1178 if ( $settings['link']['is_external'] ) {
1179 $this->add_render_attribute( 'link-primary', 'target', '_blank' );
1180 }
1181 if ( $settings['link']['nofollow'] ) {
1182 $this->add_render_attribute( 'link-primary', 'rel', 'nofollow' );
1183 }
1184
1185 printf( '<a %1$s><%2$s class="aux-modern-heading-primary">%3$s</%2$s></a>',
1186 $this->get_render_attribute_string( 'link-primary' ),
1187 tag_escape( $settings['title_tag'] ),
1188 wp_kses_post( $settings['title'] )
1189 );
1190
1191 } else {
1192 printf( '<%1$s class="aux-modern-heading-primary">%2$s</%1$s>',
1193 tag_escape( $settings['title_tag'] ),
1194 wp_kses_post( $settings['title'] )
1195 );
1196 }
1197
1198 // Maybe print divider between
1199 if( 'between' == $settings['divider_position'] ){
1200 echo wp_kses_post( $divider_markup );
1201 }
1202
1203 // Print Secondary Heading
1204 $before_heading = $settings['title_secondary_before'] ? '' . '<span class="aux-head-before">' . wp_kses_post( $settings['title_secondary_before'] ) . '</span>' : '';
1205 $highlight_heading = $settings['title_secondary_highlight'] ? '' . '<span class="aux-head-highlight">' . wp_kses_post( $settings['title_secondary_highlight'] ) . '</span>' : '';
1206 $after_heading = $settings['title_secondary_after' ] ? '' . '<span class="aux-head-after">' . wp_kses_post( $settings['title_secondary_after' ] ) . '</span>' : '';
1207
1208 if( $before_heading || $highlight_heading || $after_heading ){
1209
1210 if( ! empty( $settings['link_secondary']['url'] ) ){
1211
1212 // Make Link attributes
1213 $this->add_render_attribute( 'link-secondary', 'href', esc_url( $settings['link_secondary']['url'] ) );
1214 $this->add_render_attribute( 'link-secondary', 'class', 'aux-modern-heading-secondary-link' );
1215 if ( $settings['link_secondary']['is_external'] ) {
1216 $this->add_render_attribute( 'link-secondary', 'target', '_blank' );
1217 }
1218 if ( $settings['link_secondary']['nofollow'] ) {
1219 $this->add_render_attribute( 'link-secondary', 'rel', 'nofollow' );
1220 }
1221
1222 printf( '<a %1$s><%2$s class="aux-modern-heading-secondary">%3$s%4$s%5$s</%2$s></a>',
1223 $this->get_render_attribute_string( 'link-secondary' ),
1224 tag_escape( $settings['title_tag_secondary'] ),
1225 wp_kses_post( $before_heading ),
1226 wp_kses_post( $highlight_heading ),
1227 wp_kses_post( $after_heading )
1228 );
1229 } else {
1230 printf( '<%1$s class="aux-modern-heading-secondary">%2$s%3$s%4$s</%1$s>',
1231 tag_escape( $settings['title_tag_secondary'] ),
1232 wp_kses_post( $before_heading ),
1233 wp_kses_post( $highlight_heading ),
1234 wp_kses_post( $after_heading )
1235 );
1236 }
1237
1238 }
1239
1240 // Maybe Print divider after
1241 if( 'after' == $settings['divider_position'] ){
1242 echo wp_kses_post( $divider_markup );
1243 }
1244
1245 if( ! empty( $settings['description'] ) ){
1246 printf( '<div class="aux-modern-heading-description">%s</div>',
1247 wp_kses_post( $settings['description'] )
1248 );
1249 }
1250
1251 echo '</div>
1252 </section>';
1253 }
1254
1255 }
1256