| @@ -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 | |
| @@ -576,8 +579,9 @@ | ||
| 576 | 579 | ] |
| 577 | 580 | ); |
| 578 | 581 | |
| 579 | 582 | $this->end_controls_section(); |
| 583 | + | |
| 580 | 584 | } |
| 581 | 585 | |
| 582 | 586 | /** |
| 583 | 587 | * Render social icons widget output on the frontend. |
| @@ -588,20 +592,11 @@ | ||
| 588 | 592 | * @access protected |
| 589 | 593 | */ |
| 590 | 594 | protected function render() { |
| 591 | 595 | $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 | 596 | $fallback_defaults = [ |
| 602 | 597 | 'fa fa-facebook', |
| 603 | - 'fa fa-x-twitter', | |
| 598 | + 'fa fa-twitter', | |
| 604 | 599 | 'fa fa-google-plus', |
| 605 | 600 | ]; |
| 606 | 601 | |
| 607 | 602 | $class_animation = ''; |
| @@ -612,9 +607,9 @@ | ||
| 612 | 607 | |
| 613 | 608 | $migration_allowed = Icons_Manager::is_migration_allowed(); |
| 614 | 609 | |
| 615 | 610 | ?> |
| 616 | - <div <?php $this->print_render_attribute_string( 'wrapper' ); ?>> | |
| 611 | + <div class="elementor-social-icons-wrapper elementor-grid"> | |
| 617 | 612 | <?php |
| 618 | 613 | foreach ( $settings['social_icon_list'] as $index => $item ) { |
| 619 | 614 | $migrated = isset( $item['__fa4_migrated']['social_icon'] ); |
| 620 | 615 | $is_new = empty( $item['social'] ) && $migration_allowed; |
| @@ -652,16 +647,16 @@ | ||
| 652 | 647 | |
| 653 | 648 | $this->add_link_attributes( $link_key, $item['link'] ); |
| 654 | 649 | |
| 655 | 650 | ?> |
| 656 | - <span <?php $this->print_render_attribute_string( 'item_wrapper' ); ?>> | |
| 651 | + <span class="elementor-grid-item"> | |
| 657 | 652 | <a <?php $this->print_render_attribute_string( $link_key ); ?>> |
| 658 | 653 | <span class="elementor-screen-only"><?php echo esc_html( ucwords( $social ) ); ?></span> |
| 659 | 654 | <?php |
| 660 | 655 | if ( $is_new || $migrated ) { |
| 661 | - Icons_Manager::render_icon( $item['social_icon'], [ 'aria-hidden' => 'true' ] ); | |
| 656 | + Icons_Manager::render_icon( $item['social_icon'] ); | |
| 662 | 657 | } else { ?> |
| 663 | - <i class="<?php echo esc_attr( $item['social'] ); ?>" aria-hidden="true"></i> | |
| 658 | + <i class="<?php echo esc_attr( $item['social'] ); ?>"></i> | |
| 664 | 659 | <?php } ?> |
| 665 | 660 | </a> |
| 666 | 661 | </span> |
| 667 | 662 | <?php } ?> |
| @@ -678,26 +673,16 @@ | ||
| 678 | 673 | * @access protected |
| 679 | 674 | */ |
| 680 | 675 | protected function content_template() { |
| 681 | 676 | ?> |
| 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' ) }}}> | |
| 677 | + <# var iconsHTML = {}; #> | |
| 678 | + <div class="elementor-social-icons-wrapper elementor-grid"> | |
| 694 | 679 | <# _.each( settings.social_icon_list, function( item, index ) { |
| 695 | 680 | var link = item.link ? item.link.url : '', |
| 696 | 681 | migrated = elementor.helpers.isIconMigrated( item, 'social_icon' ); |
| 697 | 682 | social = elementor.helpers.getSocialNetworkNameFromIcon( item.social_icon, item.social, false, migrated ); |
| 698 | 683 | #> |
| 699 | - <span {{{ view.getRenderAttributeString( 'item_wrapper' ) }}}> | |
| 684 | + <span class="elementor-grid-item"> | |
| 700 | 685 | <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 | 686 | <span class="elementor-screen-only">{{{ social }}}</span> |
| 702 | 687 | <# |
| 703 | 688 | iconsHTML[ index ] = elementor.helpers.renderIcon( view, item.social_icon, {}, 'i', 'object' ); |
| @@ -711,49 +696,6 @@ | ||
| 711 | 696 | </span> |
| 712 | 697 | <# } ); #> |
| 713 | 698 | </div> |
| 714 | 699 | <?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 | 700 | } |
| 759 | 701 | } |