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