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