PluginProbe
Elementor Website Builder – more than just a page builder / 3.28.0-dev2
Elementor Website Builder – more than just a page builder v3.28.0-dev2
4.3.1 4.3.0 4.3.0-beta3 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 All 454 releases
← All changes | includes/widgets/social-icons.php +12 -71 4.2.0-beta1 → 3.28.0-dev2 View file →
@@ -258,9 +258,9 @@
258 258 ],
259 259 ],
260 260 [
261 261 'social_icon' => [
262 - 'value' => 'fab fa-x-twitter',
262 + 'value' => 'fab fa-twitter',
263 263 'library' => 'fa-brands',
264 264 ],
265 265 ],
266 266 [
@@ -310,8 +310,11 @@
310 310 ],
311 311 ]
312 312 );
313 313
314 + $start = is_rtl() ? 'end' : 'start';
315 + $end = is_rtl() ? 'start' : 'end';
316 +
314 317 $align_selector = Plugin::$instance->experiments->is_feature_active( 'e_optimized_markup' ) && ! $this->has_widget_inner_wrapper()
315 318 ? '{{WRAPPER}}'
316 319 : '{{WRAPPER}} .elementor-widget-container';
317 320
@@ -588,20 +591,11 @@
588 591 * @access protected
589 592 */
590 593 protected function render() {
591 594 $settings = $this->get_settings_for_display();
592 -
593 - $this->add_render_attribute( 'wrapper', 'class', [ 'elementor-social-icons-wrapper', 'elementor-grid' ] );
594 - $this->add_render_attribute( 'item_wrapper', 'class', 'elementor-grid-item' );
595 -
596 - if ( count( $settings['social_icon_list'] ) > 1 ) {
597 - $this->add_render_attribute( 'wrapper', 'role', 'list' );
598 - $this->add_render_attribute( 'item_wrapper', 'role', 'listitem' );
599 - }
600 -
601 595 $fallback_defaults = [
602 596 'fa fa-facebook',
603 - 'fa fa-x-twitter',
597 + 'fa fa-twitter',
604 598 'fa fa-google-plus',
605 599 ];
606 600
607 601 $class_animation = '';
@@ -612,9 +606,9 @@
612 606
613 607 $migration_allowed = Icons_Manager::is_migration_allowed();
614 608
615 609 ?>
616 - <div <?php $this->print_render_attribute_string( 'wrapper' ); ?>>
610 + <div class="elementor-social-icons-wrapper elementor-grid">
617 611 <?php
618 612 foreach ( $settings['social_icon_list'] as $index => $item ) {
619 613 $migrated = isset( $item['__fa4_migrated']['social_icon'] );
620 614 $is_new = empty( $item['social'] ) && $migration_allowed;
@@ -652,16 +646,16 @@
652 646
653 647 $this->add_link_attributes( $link_key, $item['link'] );
654 648
655 649 ?>
656 - <span <?php $this->print_render_attribute_string( 'item_wrapper' ); ?>>
650 + <span class="elementor-grid-item">
657 651 <a <?php $this->print_render_attribute_string( $link_key ); ?>>
658 652 <span class="elementor-screen-only"><?php echo esc_html( ucwords( $social ) ); ?></span>
659 653 <?php
660 654 if ( $is_new || $migrated ) {
661 - Icons_Manager::render_icon( $item['social_icon'], [ 'aria-hidden' => 'true' ] );
655 + Icons_Manager::render_icon( $item['social_icon'] );
662 656 } else { ?>
663 - <i class="<?php echo esc_attr( $item['social'] ); ?>" aria-hidden="true"></i>
657 + <i class="<?php echo esc_attr( $item['social'] ); ?>"></i>
664 658 <?php } ?>
665 659 </a>
666 660 </span>
667 661 <?php } ?>
@@ -678,26 +672,16 @@
678 672 * @access protected
679 673 */
680 674 protected function content_template() {
681 675 ?>
682 - <#
683 - view.addRenderAttribute( 'wrapper', 'class', [ 'elementor-social-icons-wrapper', 'elementor-grid' ] );
684 - view.addRenderAttribute( 'item_wrapper', 'class', 'elementor-grid-item' );
685 -
686 - if ( settings.social_icon_list.length > 1 ) {
687 - view.addRenderAttribute( 'wrapper', 'role', 'list' );
688 - view.addRenderAttribute( 'item_wrapper', 'role', 'listitem' );
689 - }
690 -
691 - var iconsHTML = {};
692 - #>
693 - <div {{{ view.getRenderAttributeString( 'wrapper' ) }}}>
676 + <# var iconsHTML = {}; #>
677 + <div class="elementor-social-icons-wrapper elementor-grid">
694 678 <# _.each( settings.social_icon_list, function( item, index ) {
695 679 var link = item.link ? item.link.url : '',
696 680 migrated = elementor.helpers.isIconMigrated( item, 'social_icon' );
697 681 social = elementor.helpers.getSocialNetworkNameFromIcon( item.social_icon, item.social, false, migrated );
698 682 #>
699 - <span {{{ view.getRenderAttributeString( 'item_wrapper' ) }}}>
683 + <span class="elementor-grid-item">
700 684 <a class="elementor-icon elementor-social-icon elementor-social-icon-{{ social }} elementor-animation-{{ settings.hover_animation }} elementor-repeater-item-{{item._id}}" href="{{ elementor.helpers.sanitizeUrl( link ) }}">
701 685 <span class="elementor-screen-only">{{{ social }}}</span>
702 686 <#
703 687 iconsHTML[ index ] = elementor.helpers.renderIcon( view, item.social_icon, {}, 'i', 'object' );
@@ -711,49 +695,6 @@
711 695 </span>
712 696 <# } ); #>
713 697 </div>
714 698 <?php
715 - }
716 -
717 - public function render_markdown(): string {
718 - $settings = $this->get_settings_for_display();
719 - if ( empty( $settings['social_icon_list'] ) ) {
720 - return '';
721 - }
722 -
723 - $migration_allowed = Icons_Manager::is_migration_allowed();
724 - $links = [];
725 -
726 - foreach ( $settings['social_icon_list'] as $item ) {
727 - $url = $item['link']['url'] ?? '';
728 - if ( empty( $url ) ) {
729 - continue;
730 - }
731 -
732 - $migrated = isset( $item['__fa4_migrated']['social_icon'] );
733 - $is_new = empty( $item['social'] ) && $migration_allowed;
734 - $social = '';
735 -
736 - if ( ! empty( $item['social'] ) ) {
737 - $social = str_replace( 'fa fa-', '', $item['social'] );
738 - }
739 -
740 - if ( ( $is_new || $migrated ) && 'svg' !== ( $item['social_icon']['library'] ?? '' ) ) {
741 - $parts = explode( ' ', $item['social_icon']['value'] ?? '', 2 );
742 - $social = ! empty( $parts[1] ) ? str_replace( 'fa-', '', $parts[1] ) : '';
743 - }
744 -
745 - if ( 'svg' === ( $item['social_icon']['library'] ?? '' ) ) {
746 - $social = get_post_meta( $item['social_icon']['value']['id'] ?? 0, '_wp_attachment_image_alt', true );
747 - }
748 -
749 - $label = ucwords( str_replace( '-', ' ', $social ) );
750 - if ( empty( $label ) ) {
751 - $label = 'Link';
752 - }
753 -
754 - $links[] = '- [' . $label . '](' . esc_url( $url ) . ')';
755 - }
756 -
757 - return implode( "\n", $links );
758 699 }
759 700 }