| @@ -73,31 +73,9 @@ | ||
| 73 | 73 | public function get_keywords() { |
| 74 | 74 | return [ 'alert', 'notice', 'message' ]; |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | - protected function is_dynamic_content(): bool { | |
| 78 | - return false; | |
| 79 | - } | |
| 80 | - | |
| 81 | 77 | /** |
| 82 | - * Get style dependencies. | |
| 83 | - * | |
| 84 | - * Retrieve the list of style dependencies the widget requires. | |
| 85 | - * | |
| 86 | - * @since 3.24.0 | |
| 87 | - * @access public | |
| 88 | - * | |
| 89 | - * @return array Widget style dependencies. | |
| 90 | - */ | |
| 91 | - public function get_style_depends(): array { | |
| 92 | - return [ 'widget-alert' ]; | |
| 93 | - } | |
| 94 | - | |
| 95 | - public function has_widget_inner_wrapper(): bool { | |
| 96 | - return ! Plugin::$instance->experiments->is_feature_active( 'e_optimized_markup' ); | |
| 97 | - } | |
| 98 | - | |
| 99 | - /** | |
| 100 | 78 | * Register alert widget controls. |
| 101 | 79 | * |
| 102 | 80 | * Adds different input fields to allow the user to change and customize the widget settings. |
| 103 | 81 | * |
| @@ -225,12 +203,12 @@ | ||
| 225 | 203 | |
| 226 | 204 | $this->add_control( |
| 227 | 205 | 'border_color', |
| 228 | 206 | [ |
| 229 | - 'label' => esc_html__( 'Side Border Color', 'elementor' ), | |
| 207 | + 'label' => esc_html__( 'Border Color', 'elementor' ), | |
| 230 | 208 | 'type' => Controls_Manager::COLOR, |
| 231 | 209 | 'selectors' => [ |
| 232 | - '{{WRAPPER}} .elementor-alert' => 'border-inline-start-color: {{VALUE}};', | |
| 210 | + '{{WRAPPER}} .elementor-alert' => 'border-color: {{VALUE}};', | |
| 233 | 211 | ], |
| 234 | 212 | ] |
| 235 | 213 | ); |
| 236 | 214 | |
| @@ -236,9 +214,9 @@ | ||
| 236 | 214 | |
| 237 | 215 | $this->add_control( |
| 238 | 216 | 'border_left-width', |
| 239 | 217 | [ |
| 240 | - 'label' => esc_html__( 'Side Border Width', 'elementor' ), | |
| 218 | + 'label' => esc_html__( 'Left Border Width', 'elementor' ), | |
| 241 | 219 | 'type' => Controls_Manager::SLIDER, |
| 242 | 220 | 'size_units' => [ 'px', '%', 'em', 'rem', 'custom' ], |
| 243 | 221 | 'range' => [ |
| 244 | 222 | 'px' => [ |
| @@ -248,9 +226,9 @@ | ||
| 248 | 226 | 'max' => 10, |
| 249 | 227 | ], |
| 250 | 228 | ], |
| 251 | 229 | 'selectors' => [ |
| 252 | - '{{WRAPPER}} .elementor-alert' => 'border-inline-start-width: {{SIZE}}{{UNIT}};', | |
| 230 | + '{{WRAPPER}} .elementor-alert' => 'border-left-width: {{SIZE}}{{UNIT}};', | |
| 253 | 231 | ], |
| 254 | 232 | ] |
| 255 | 233 | ); |
| 256 | 234 | |
| @@ -494,17 +472,17 @@ | ||
| 494 | 472 | ?> |
| 495 | 473 | <div <?php $this->print_render_attribute_string( 'alert_wrapper' ); ?>> |
| 496 | 474 | |
| 497 | 475 | <?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> | |
| 476 | + <span <?php $this->print_render_attribute_string( 'alert_title' ); ?>><?php $this->print_unescaped_setting( 'alert_title' ); ?></span> | |
| 499 | 477 | <?php endif; ?> |
| 500 | 478 | |
| 501 | 479 | <?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> | |
| 480 | + <span <?php $this->print_render_attribute_string( 'alert_description' ); ?>><?php $this->print_unescaped_setting( 'alert_description' ); ?></span> | |
| 503 | 481 | <?php endif; ?> |
| 504 | 482 | |
| 505 | 483 | <?php if ( 'show' === $settings['show_dismiss'] ) : ?> |
| 506 | - <button type="button" class="elementor-alert-dismiss" aria-label="<?php echo esc_attr__( 'Dismiss this alert.', 'elementor' ); ?>"> | |
| 484 | + <button type="button" class="elementor-alert-dismiss"> | |
| 507 | 485 | <?php |
| 508 | 486 | if ( ! empty( $settings['dismiss_icon']['value'] ) ) { |
| 509 | 487 | Icons_Manager::render_icon( $settings['dismiss_icon'], [ 'aria-hidden' => 'true' ] ); |
| 510 | 488 | } else { ?> |
| @@ -509,8 +487,9 @@ | ||
| 509 | 487 | Icons_Manager::render_icon( $settings['dismiss_icon'], [ 'aria-hidden' => 'true' ] ); |
| 510 | 488 | } else { ?> |
| 511 | 489 | <span aria-hidden="true">×</span> |
| 512 | 490 | <?php } ?> |
| 491 | + <span class="elementor-screen-only"><?php echo esc_html__( 'Dismiss this alert.', 'elementor' ); ?></span> | |
| 513 | 492 | </button> |
| 514 | 493 | <?php endif; ?> |
| 515 | 494 | |
| 516 | 495 | </div> |
| @@ -524,29 +503,8 @@ | ||
| 524 | 503 | * |
| 525 | 504 | * @since 2.9.0 |
| 526 | 505 | * @access protected |
| 527 | 506 | */ |
| 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 | 507 | protected function content_template() { |
| 550 | 508 | ?> |
| 551 | 509 | <# |
| 552 | 510 | if ( ! settings.alert_title && ! settings.alert_description ) { |
| @@ -570,22 +528,23 @@ | ||
| 570 | 528 | #> |
| 571 | 529 | <div {{{ view.getRenderAttributeString( 'alert_wrapper' ) }}}> |
| 572 | 530 | |
| 573 | 531 | <# if ( settings.alert_title ) { #> |
| 574 | - <span {{{ view.getRenderAttributeString( 'alert_title' ) }}}>{{ settings.alert_title }}</span> | |
| 532 | + <span {{{ view.getRenderAttributeString( 'alert_title' ) }}}>{{{ settings.alert_title }}}</span> | |
| 575 | 533 | <# } #> |
| 576 | 534 | |
| 577 | 535 | <# if ( settings.alert_description ) { #> |
| 578 | - <span {{{ view.getRenderAttributeString( 'alert_description' ) }}}>{{ settings.alert_description }}</span> | |
| 536 | + <span {{{ view.getRenderAttributeString( 'alert_description' ) }}}>{{{ settings.alert_description }}}</span> | |
| 579 | 537 | <# } #> |
| 580 | 538 | |
| 581 | 539 | <# if ( 'show' === settings.show_dismiss ) { #> |
| 582 | - <button type="button" class="elementor-alert-dismiss" aria-label="<?php echo esc_attr__( 'Dismiss this alert.', 'elementor' ); ?>"> | |
| 540 | + <button type="button" class="elementor-alert-dismiss"> | |
| 583 | 541 | <# if ( iconHTML && iconHTML.rendered && ( ! settings.icon || migrated ) ) { #> |
| 584 | 542 | {{{ iconHTML.value }}} |
| 585 | 543 | <# } else { #> |
| 586 | 544 | <span aria-hidden="true">×</span> |
| 587 | 545 | <# } #> |
| 546 | + <span class="elementor-screen-only"><?php echo esc_html__( 'Dismiss this alert.', 'elementor' ); ?></span> | |
| 588 | 547 | </button> |
| 589 | 548 | <# } #> |
| 590 | 549 | |
| 591 | 550 | </div> |