| @@ -73,12 +73,8 @@ | ||
| 73 | 73 | public function get_categories() { |
| 74 | 74 | return [ 'basic' ]; |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | - public function has_widget_inner_wrapper(): bool { | |
| 78 | - return ! Plugin::$instance->experiments->is_feature_active( 'e_optimized_markup' ); | |
| 79 | - } | |
| 80 | - | |
| 81 | 77 | /** |
| 82 | 78 | * Get widget keywords. |
| 83 | 79 | * |
| 84 | 80 | * Retrieve the list of keywords the widget belongs to. |
| @@ -91,12 +87,8 @@ | ||
| 91 | 87 | public function get_keywords() { |
| 92 | 88 | return [ 'icon' ]; |
| 93 | 89 | } |
| 94 | 90 | |
| 95 | - protected function is_dynamic_content(): bool { | |
| 96 | - return false; | |
| 97 | - } | |
| 98 | - | |
| 99 | 91 | /** |
| 100 | 92 | * Register icon widget controls. |
| 101 | 93 | * |
| 102 | 94 | * Adds different input fields to allow the user to change and customize the widget settings. |
| @@ -145,11 +137,10 @@ | ||
| 145 | 137 | [ |
| 146 | 138 | 'label' => esc_html__( 'Shape', 'elementor' ), |
| 147 | 139 | 'type' => Controls_Manager::SELECT, |
| 148 | 140 | 'options' => [ |
| 141 | + 'circle' => esc_html__( 'Circle', 'elementor' ), | |
| 149 | 142 | 'square' => esc_html__( 'Square', 'elementor' ), |
| 150 | - 'rounded' => esc_html__( 'Rounded', 'elementor' ), | |
| 151 | - 'circle' => esc_html__( 'Circle', 'elementor' ), | |
| 152 | 143 | ], |
| 153 | 144 | 'default' => 'circle', |
| 154 | 145 | 'condition' => [ |
| 155 | 146 | 'view!' => 'default', |
| @@ -184,10 +175,10 @@ | ||
| 184 | 175 | [ |
| 185 | 176 | 'label' => esc_html__( 'Alignment', 'elementor' ), |
| 186 | 177 | 'type' => Controls_Manager::CHOOSE, |
| 187 | 178 | 'options' => [ |
| 188 | - 'start' => [ | |
| 189 | - 'title' => esc_html__( 'Start', 'elementor' ), | |
| 179 | + 'left' => [ | |
| 180 | + 'title' => esc_html__( 'Left', 'elementor' ), | |
| 190 | 181 | 'icon' => 'eicon-text-align-left', |
| 191 | 182 | ], |
| 192 | 183 | 'center' => [ |
| 193 | 184 | 'title' => esc_html__( 'Center', 'elementor' ), |
| @@ -192,18 +183,13 @@ | ||
| 192 | 183 | 'center' => [ |
| 193 | 184 | 'title' => esc_html__( 'Center', 'elementor' ), |
| 194 | 185 | 'icon' => 'eicon-text-align-center', |
| 195 | 186 | ], |
| 196 | - 'end' => [ | |
| 197 | - 'title' => esc_html__( 'End', 'elementor' ), | |
| 187 | + 'right' => [ | |
| 188 | + 'title' => esc_html__( 'Right', 'elementor' ), | |
| 198 | 189 | 'icon' => 'eicon-text-align-right', |
| 199 | 190 | ], |
| 200 | 191 | ], |
| 201 | - 'classes' => 'elementor-control-start-end', | |
| 202 | - 'selectors_dictionary' => [ | |
| 203 | - 'left' => is_rtl() ? 'end' : 'start', | |
| 204 | - 'right' => is_rtl() ? 'start' : 'end', | |
| 205 | - ], | |
| 206 | 192 | 'default' => 'center', |
| 207 | 193 | 'selectors' => [ |
| 208 | 194 | '{{WRAPPER}} .elementor-icon-wrapper' => 'text-align: {{VALUE}};', |
| 209 | 195 | ], |
| @@ -336,9 +322,9 @@ | ||
| 336 | 322 | 'condition' => [ |
| 337 | 323 | 'selected_icon[library]' => 'svg', |
| 338 | 324 | ], |
| 339 | 325 | 'selectors' => [ |
| 340 | - '{{WRAPPER}} .elementor-icon-wrapper svg' => 'width: auto;', | |
| 326 | + '{{WRAPPER}} .elementor-icon-wrapper svg' => 'width: 100%;', | |
| 341 | 327 | ], |
| 342 | 328 | ] |
| 343 | 329 | ); |
| 344 | 330 | |
| @@ -469,15 +455,15 @@ | ||
| 469 | 455 | $is_new = empty( $settings['icon'] ) && Icons_Manager::is_migration_allowed(); |
| 470 | 456 | |
| 471 | 457 | ?> |
| 472 | 458 | <div <?php $this->print_render_attribute_string( 'wrapper' ); ?>> |
| 473 | - <<?php Utils::print_validated_html_tag( $icon_tag ); ?> <?php $this->print_render_attribute_string( 'icon-wrapper' ); ?>> | |
| 459 | + <<?php Utils::print_unescaped_internal_string( $icon_tag . ' ' . $this->get_render_attribute_string( 'icon-wrapper' ) ); ?>> | |
| 474 | 460 | <?php if ( $is_new || $migrated ) : |
| 475 | 461 | Icons_Manager::render_icon( $settings['selected_icon'], [ 'aria-hidden' => 'true' ] ); |
| 476 | 462 | else : ?> |
| 477 | 463 | <i <?php $this->print_render_attribute_string( 'icon' ); ?>></i> |
| 478 | 464 | <?php endif; ?> |
| 479 | - </<?php Utils::print_validated_html_tag( $icon_tag ); ?>> | |
| 465 | + </<?php Utils::print_unescaped_internal_string( $icon_tag ); ?>> | |
| 480 | 466 | </div> |
| 481 | 467 | <?php |
| 482 | 468 | } |
| 483 | 469 | |
| @@ -495,26 +481,15 @@ | ||
| 495 | 481 | if ( '' === settings.selected_icon.value ) { |
| 496 | 482 | return; |
| 497 | 483 | } |
| 498 | 484 | |
| 499 | - let iconTag = 'div'; | |
| 500 | - | |
| 501 | - if ( settings.link?.url ) { | |
| 502 | - view.addRenderAttribute( 'link_url', 'href', elementor.helpers.sanitizeUrl( settings.link?.url ) ); | |
| 503 | - iconTag = 'a'; | |
| 504 | - } | |
| 505 | - | |
| 506 | - const iconHTML = elementor.helpers.renderIcon( view, settings.selected_icon, { 'aria-hidden': true }, 'i' , 'object' ), | |
| 507 | - migrated = elementor.helpers.isIconMigrated( settings, 'selected_icon' ); | |
| 508 | - | |
| 509 | - view.addRenderAttribute( 'icon', 'class', 'elementor-icon' ); | |
| 510 | - | |
| 511 | - if ( '' !== settings.hover_animation ) { | |
| 512 | - view.addRenderAttribute( 'icon', 'class', 'elementor-animation-' + settings.hover_animation ); | |
| 513 | - } | |
| 485 | + const link = settings.link.url ? 'href="' + _.escape( settings.link.url ) + '"' : '', | |
| 486 | + iconHTML = elementor.helpers.renderIcon( view, settings.selected_icon, { 'aria-hidden': true }, 'i' , 'object' ), | |
| 487 | + migrated = elementor.helpers.isIconMigrated( settings, 'selected_icon' ), | |
| 488 | + iconTag = link ? 'a' : 'div'; | |
| 514 | 489 | #> |
| 515 | 490 | <div class="elementor-icon-wrapper"> |
| 516 | - <{{{ iconTag }}} {{{ view.getRenderAttributeString( 'icon' ) }}} {{{ view.getRenderAttributeString( 'link_url' ) }}}> | |
| 491 | + <{{{ iconTag }}} class="elementor-icon elementor-animation-{{ settings.hover_animation }}" {{{ link }}}> | |
| 517 | 492 | <# if ( iconHTML && iconHTML.rendered && ( ! settings.icon || migrated ) ) { #> |
| 518 | 493 | {{{ iconHTML.value }}} |
| 519 | 494 | <# } else { #> |
| 520 | 495 | <i class="{{ settings.icon }}" aria-hidden="true"></i> |
| @@ -521,10 +496,6 @@ | ||
| 521 | 496 | <# } #> |
| 522 | 497 | </{{{ iconTag }}}> |
| 523 | 498 | </div> |
| 524 | 499 | <?php |
| 525 | - } | |
| 526 | - | |
| 527 | - public function render_markdown(): string { | |
| 528 | - return ''; | |
| 529 | 500 | } |
| 530 | 501 | } |