PluginProbe
Elementor Website Builder – more than just a page builder / 3.20.0-dev2
Elementor Website Builder – more than just a page builder v3.20.0-dev2
4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 4.1.0-beta1 4.1.0-dev1 4.0.7 All 451 releases
← All changes | includes/widgets/icon.php +13 -51 4.2.13.20.0-dev2 View file →
@@ -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
@@ -434,12 +420,8 @@
434 420 */
435 421 protected function render() {
436 422 $settings = $this->get_settings_for_display();
437 423
438 - if ( empty( $settings['selected_icon']['value'] ) ) {
439 - return;
440 - }
441 -
442 424 $this->add_render_attribute( 'wrapper', 'class', 'elementor-icon-wrapper' );
443 425
444 426 $this->add_render_attribute( 'icon-wrapper', 'class', 'elementor-icon' );
445 427
@@ -469,15 +451,15 @@
469 451 $is_new = empty( $settings['icon'] ) && Icons_Manager::is_migration_allowed();
470 452
471 453 ?>
472 454 <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' ); ?>>
455 + <<?php Utils::print_unescaped_internal_string( $icon_tag . ' ' . $this->get_render_attribute_string( 'icon-wrapper' ) ); ?>>
474 456 <?php if ( $is_new || $migrated ) :
475 457 Icons_Manager::render_icon( $settings['selected_icon'], [ 'aria-hidden' => 'true' ] );
476 458 else : ?>
477 459 <i <?php $this->print_render_attribute_string( 'icon' ); ?>></i>
478 460 <?php endif; ?>
479 - </<?php Utils::print_validated_html_tag( $icon_tag ); ?>>
461 + </<?php Utils::print_unescaped_internal_string( $icon_tag ); ?>>
480 462 </div>
481 463 <?php
482 464 }
483 465
@@ -490,31 +472,15 @@
490 472 * @access protected
491 473 */
492 474 protected function content_template() {
493 475 ?>
494 - <#
495 - if ( '' === settings.selected_icon.value ) {
496 - return;
497 - }
498 -
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 - }
476 + <# const link = settings.link.url ? 'href="' + _.escape( settings.link.url ) + '"' : '',
477 + iconHTML = elementor.helpers.renderIcon( view, settings.selected_icon, { 'aria-hidden': true }, 'i' , 'object' ),
478 + migrated = elementor.helpers.isIconMigrated( settings, 'selected_icon' ),
479 + iconTag = link ? 'a' : 'div';
514 480 #>
515 481 <div class="elementor-icon-wrapper">
516 - <{{{ iconTag }}} {{{ view.getRenderAttributeString( 'icon' ) }}} {{{ view.getRenderAttributeString( 'link_url' ) }}}>
482 + <{{{ iconTag }}} class="elementor-icon elementor-animation-{{ settings.hover_animation }}" {{{ link }}}>
517 483 <# if ( iconHTML && iconHTML.rendered && ( ! settings.icon || migrated ) ) { #>
518 484 {{{ iconHTML.value }}}
519 485 <# } else { #>
520 486 <i class="{{ settings.icon }}" aria-hidden="true"></i>
@@ -521,10 +487,6 @@
521 487 <# } #>
522 488 </{{{ iconTag }}}>
523 489 </div>
524 490 <?php
525 - }
526 -
527 - public function render_markdown(): string {
528 - return '';
529 491 }
530 492 }