| @@ -91,12 +91,8 @@ | ||
| 91 | 91 | public function get_style_depends(): array { |
| 92 | 92 | return [ 'widget-alert' ]; |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | - public function has_widget_inner_wrapper(): bool { | |
| 96 | - return ! Plugin::$instance->experiments->is_feature_active( 'e_optimized_markup' ); | |
| 97 | - } | |
| 98 | - | |
| 99 | 95 | /** |
| 100 | 96 | * Register alert widget controls. |
| 101 | 97 | * |
| 102 | 98 | * Adds different input fields to allow the user to change and customize the widget settings. |
| @@ -225,12 +221,12 @@ | ||
| 225 | 221 | |
| 226 | 222 | $this->add_control( |
| 227 | 223 | 'border_color', |
| 228 | 224 | [ |
| 229 | - 'label' => esc_html__( 'Side Border Color', 'elementor' ), | |
| 225 | + 'label' => esc_html__( 'Border Color', 'elementor' ), | |
| 230 | 226 | 'type' => Controls_Manager::COLOR, |
| 231 | 227 | 'selectors' => [ |
| 232 | - '{{WRAPPER}} .elementor-alert' => 'border-inline-start-color: {{VALUE}};', | |
| 228 | + '{{WRAPPER}} .elementor-alert' => 'border-color: {{VALUE}};', | |
| 233 | 229 | ], |
| 234 | 230 | ] |
| 235 | 231 | ); |
| 236 | 232 | |
| @@ -236,9 +232,9 @@ | ||
| 236 | 232 | |
| 237 | 233 | $this->add_control( |
| 238 | 234 | 'border_left-width', |
| 239 | 235 | [ |
| 240 | - 'label' => esc_html__( 'Side Border Width', 'elementor' ), | |
| 236 | + 'label' => esc_html__( 'Left Border Width', 'elementor' ), | |
| 241 | 237 | 'type' => Controls_Manager::SLIDER, |
| 242 | 238 | 'size_units' => [ 'px', '%', 'em', 'rem', 'custom' ], |
| 243 | 239 | 'range' => [ |
| 244 | 240 | 'px' => [ |
| @@ -248,9 +244,9 @@ | ||
| 248 | 244 | 'max' => 10, |
| 249 | 245 | ], |
| 250 | 246 | ], |
| 251 | 247 | 'selectors' => [ |
| 252 | - '{{WRAPPER}} .elementor-alert' => 'border-inline-start-width: {{SIZE}}{{UNIT}};', | |
| 248 | + '{{WRAPPER}} .elementor-alert' => 'border-left-width: {{SIZE}}{{UNIT}};', | |
| 253 | 249 | ], |
| 254 | 250 | ] |
| 255 | 251 | ); |
| 256 | 252 | |
| @@ -494,17 +490,17 @@ | ||
| 494 | 490 | ?> |
| 495 | 491 | <div <?php $this->print_render_attribute_string( 'alert_wrapper' ); ?>> |
| 496 | 492 | |
| 497 | 493 | <?php if ( ! Utils::is_empty( $settings['alert_title'] ) ) : ?> |
| 498 | - <span <?php $this->print_render_attribute_string( 'alert_title' ); ?>><?php echo wp_kses_post( $settings['alert_title'] ); ?></span> | |
| 494 | + <span <?php $this->print_render_attribute_string( 'alert_title' ); ?>><?php $this->print_unescaped_setting( 'alert_title' ); ?></span> | |
| 499 | 495 | <?php endif; ?> |
| 500 | 496 | |
| 501 | 497 | <?php if ( ! Utils::is_empty( $settings['alert_description'] ) ) : ?> |
| 502 | - <span <?php $this->print_render_attribute_string( 'alert_description' ); ?>><?php echo wp_kses_post( $settings['alert_description'] ); ?></span> | |
| 498 | + <span <?php $this->print_render_attribute_string( 'alert_description' ); ?>><?php $this->print_unescaped_setting( 'alert_description' ); ?></span> | |
| 503 | 499 | <?php endif; ?> |
| 504 | 500 | |
| 505 | 501 | <?php if ( 'show' === $settings['show_dismiss'] ) : ?> |
| 506 | - <button type="button" class="elementor-alert-dismiss" aria-label="<?php echo esc_attr__( 'Dismiss this alert.', 'elementor' ); ?>"> | |
| 502 | + <button type="button" class="elementor-alert-dismiss"> | |
| 507 | 503 | <?php |
| 508 | 504 | if ( ! empty( $settings['dismiss_icon']['value'] ) ) { |
| 509 | 505 | Icons_Manager::render_icon( $settings['dismiss_icon'], [ 'aria-hidden' => 'true' ] ); |
| 510 | 506 | } else { ?> |
| @@ -509,8 +505,9 @@ | ||
| 509 | 505 | Icons_Manager::render_icon( $settings['dismiss_icon'], [ 'aria-hidden' => 'true' ] ); |
| 510 | 506 | } else { ?> |
| 511 | 507 | <span aria-hidden="true">×</span> |
| 512 | 508 | <?php } ?> |
| 509 | + <span class="elementor-screen-only"><?php echo esc_html__( 'Dismiss this alert.', 'elementor' ); ?></span> | |
| 513 | 510 | </button> |
| 514 | 511 | <?php endif; ?> |
| 515 | 512 | |
| 516 | 513 | </div> |
| @@ -524,29 +521,8 @@ | ||
| 524 | 521 | * |
| 525 | 522 | * @since 2.9.0 |
| 526 | 523 | * @access protected |
| 527 | 524 | */ |
| 528 | - public function render_markdown(): string { | |
| 529 | - $settings = $this->get_settings_for_display(); | |
| 530 | - | |
| 531 | - $title = Utils::html_to_plain_text( $settings['alert_title'] ?? '' ); | |
| 532 | - $description = Utils::html_to_plain_text( $settings['alert_description'] ?? '' ); | |
| 533 | - | |
| 534 | - if ( empty( $title ) && empty( $description ) ) { | |
| 535 | - return ''; | |
| 536 | - } | |
| 537 | - | |
| 538 | - if ( ! empty( $title ) && ! empty( $description ) ) { | |
| 539 | - return '> **' . $title . ':** ' . $description; | |
| 540 | - } | |
| 541 | - | |
| 542 | - if ( ! empty( $title ) ) { | |
| 543 | - return '> **' . $title . '**'; | |
| 544 | - } | |
| 545 | - | |
| 546 | - return '> ' . $description; | |
| 547 | - } | |
| 548 | - | |
| 549 | 525 | protected function content_template() { |
| 550 | 526 | ?> |
| 551 | 527 | <# |
| 552 | 528 | if ( ! settings.alert_title && ! settings.alert_description ) { |
| @@ -570,22 +546,23 @@ | ||
| 570 | 546 | #> |
| 571 | 547 | <div {{{ view.getRenderAttributeString( 'alert_wrapper' ) }}}> |
| 572 | 548 | |
| 573 | 549 | <# if ( settings.alert_title ) { #> |
| 574 | - <span {{{ view.getRenderAttributeString( 'alert_title' ) }}}>{{ settings.alert_title }}</span> | |
| 550 | + <span {{{ view.getRenderAttributeString( 'alert_title' ) }}}>{{{ settings.alert_title }}}</span> | |
| 575 | 551 | <# } #> |
| 576 | 552 | |
| 577 | 553 | <# if ( settings.alert_description ) { #> |
| 578 | - <span {{{ view.getRenderAttributeString( 'alert_description' ) }}}>{{ settings.alert_description }}</span> | |
| 554 | + <span {{{ view.getRenderAttributeString( 'alert_description' ) }}}>{{{ settings.alert_description }}}</span> | |
| 579 | 555 | <# } #> |
| 580 | 556 | |
| 581 | 557 | <# if ( 'show' === settings.show_dismiss ) { #> |
| 582 | - <button type="button" class="elementor-alert-dismiss" aria-label="<?php echo esc_attr__( 'Dismiss this alert.', 'elementor' ); ?>"> | |
| 558 | + <button type="button" class="elementor-alert-dismiss"> | |
| 583 | 559 | <# if ( iconHTML && iconHTML.rendered && ( ! settings.icon || migrated ) ) { #> |
| 584 | 560 | {{{ iconHTML.value }}} |
| 585 | 561 | <# } else { #> |
| 586 | 562 | <span aria-hidden="true">×</span> |
| 587 | 563 | <# } #> |
| 564 | + <span class="elementor-screen-only"><?php echo esc_html__( 'Dismiss this alert.', 'elementor' ); ?></span> | |
| 588 | 565 | </button> |
| 589 | 566 | <# } #> |
| 590 | 567 | |
| 591 | 568 | </div> |