| @@ -5,9 +5,8 @@ | ||
| 5 | 5 | exit; // Exit if accessed directly. |
| 6 | 6 | } |
| 7 | 7 | |
| 8 | 8 | use Elementor\Core\Kits\Documents\Tabs\Global_Colors; |
| 9 | -use Elementor\Modules\Promotions\Controls\Promotion_Control; | |
| 10 | 9 | |
| 11 | 10 | /** |
| 12 | 11 | * Elementor image carousel widget. |
| 13 | 12 | * |
| @@ -92,26 +91,8 @@ | ||
| 92 | 91 | return [ 'e-swiper', 'widget-image-carousel' ]; |
| 93 | 92 | } |
| 94 | 93 | |
| 95 | 94 | /** |
| 96 | - * Get script dependencies. | |
| 97 | - * | |
| 98 | - * Retrieve the list of script dependencies the widget requires. | |
| 99 | - * | |
| 100 | - * @since 3.27.0 | |
| 101 | - * @access public | |
| 102 | - * | |
| 103 | - * @return array Widget script dependencies. | |
| 104 | - */ | |
| 105 | - public function get_script_depends(): array { | |
| 106 | - return [ 'swiper' ]; | |
| 107 | - } | |
| 108 | - | |
| 109 | - public function has_widget_inner_wrapper(): bool { | |
| 110 | - return ! Plugin::$instance->experiments->is_feature_active( 'e_optimized_markup' ); | |
| 111 | - } | |
| 112 | - | |
| 113 | - /** | |
| 114 | 95 | * Get widget upsale data. |
| 115 | 96 | * |
| 116 | 97 | * Retrieve the widget promotion data. |
| 117 | 98 | * |
| @@ -147,17 +128,8 @@ | ||
| 147 | 128 | ] |
| 148 | 129 | ); |
| 149 | 130 | |
| 150 | 131 | $this->add_control( |
| 151 | - 'carousel_name', | |
| 152 | - [ | |
| 153 | - 'label' => esc_html__( 'Carousel Name', 'elementor' ), | |
| 154 | - 'type' => Controls_Manager::TEXT, | |
| 155 | - 'default' => esc_html__( 'Image Carousel', 'elementor' ), | |
| 156 | - ] | |
| 157 | - ); | |
| 158 | - | |
| 159 | - $this->add_control( | |
| 160 | 132 | 'carousel', |
| 161 | 133 | [ |
| 162 | 134 | 'label' => esc_html__( 'Add Images', 'elementor' ), |
| 163 | 135 | 'type' => Controls_Manager::GALLERY, |
| @@ -658,28 +630,8 @@ | ||
| 658 | 630 | ] |
| 659 | 631 | ); |
| 660 | 632 | |
| 661 | 633 | $this->add_responsive_control( |
| 662 | - 'dots_gap', | |
| 663 | - [ | |
| 664 | - 'label' => esc_html__( 'Space Between Dots', 'elementor' ), | |
| 665 | - 'type' => Controls_Manager::SLIDER, | |
| 666 | - 'size_units' => [ 'px', 'em', 'rem', 'custom' ], | |
| 667 | - 'range' => [ | |
| 668 | - 'px' => [ | |
| 669 | - 'max' => 20, | |
| 670 | - ], | |
| 671 | - ], | |
| 672 | - 'selectors' => [ | |
| 673 | - '{{WRAPPER}} .swiper-pagination-bullet' => '--swiper-pagination-bullet-horizontal-gap: {{SIZE}}{{UNIT}}; --swiper-pagination-bullet-vertical-gap: {{SIZE}}{{UNIT}};', | |
| 674 | - ], | |
| 675 | - 'condition' => [ | |
| 676 | - 'navigation' => [ 'dots', 'both' ], | |
| 677 | - ], | |
| 678 | - ] | |
| 679 | - ); | |
| 680 | - | |
| 681 | - $this->add_responsive_control( | |
| 682 | 634 | 'dots_size', |
| 683 | 635 | [ |
| 684 | 636 | 'label' => esc_html__( 'Size', 'elementor' ), |
| 685 | 637 | 'type' => Controls_Manager::SLIDER, |
| @@ -785,9 +737,9 @@ | ||
| 785 | 737 | 'image_spacing_custom', |
| 786 | 738 | [ |
| 787 | 739 | 'label' => esc_html__( 'Image Spacing', 'elementor' ), |
| 788 | 740 | 'type' => Controls_Manager::SLIDER, |
| 789 | - 'size_units' => [ 'px' ], | |
| 741 | + 'size_units' => [ 'px', 'em', 'rem', 'custom' ], | |
| 790 | 742 | 'range' => [ |
| 791 | 743 | 'px' => [ |
| 792 | 744 | 'max' => 100, |
| 793 | 745 | ], |
| @@ -843,10 +795,10 @@ | ||
| 843 | 795 | [ |
| 844 | 796 | 'label' => esc_html__( 'Alignment', 'elementor' ), |
| 845 | 797 | 'type' => Controls_Manager::CHOOSE, |
| 846 | 798 | 'options' => [ |
| 847 | - 'start' => [ | |
| 848 | - 'title' => esc_html__( 'Start', 'elementor' ), | |
| 799 | + 'left' => [ | |
| 800 | + 'title' => esc_html__( 'Left', 'elementor' ), | |
| 849 | 801 | 'icon' => 'eicon-text-align-left', |
| 850 | 802 | ], |
| 851 | 803 | 'center' => [ |
| 852 | 804 | 'title' => esc_html__( 'Center', 'elementor' ), |
| @@ -851,10 +803,10 @@ | ||
| 851 | 803 | 'center' => [ |
| 852 | 804 | 'title' => esc_html__( 'Center', 'elementor' ), |
| 853 | 805 | 'icon' => 'eicon-text-align-center', |
| 854 | 806 | ], |
| 855 | - 'end' => [ | |
| 856 | - 'title' => esc_html__( 'End', 'elementor' ), | |
| 807 | + 'right' => [ | |
| 808 | + 'title' => esc_html__( 'Right', 'elementor' ), | |
| 857 | 809 | 'icon' => 'eicon-text-align-right', |
| 858 | 810 | ], |
| 859 | 811 | 'justify' => [ |
| 860 | 812 | 'title' => esc_html__( 'Justified', 'elementor' ), |
| @@ -860,13 +812,8 @@ | ||
| 860 | 812 | 'title' => esc_html__( 'Justified', 'elementor' ), |
| 861 | 813 | 'icon' => 'eicon-text-align-justify', |
| 862 | 814 | ], |
| 863 | 815 | ], |
| 864 | - 'classes' => 'elementor-control-start-end', | |
| 865 | - 'selectors_dictionary' => [ | |
| 866 | - 'left' => is_rtl() ? 'end' : 'start', | |
| 867 | - 'right' => is_rtl() ? 'start' : 'end', | |
| 868 | - ], | |
| 869 | 816 | 'default' => 'center', |
| 870 | 817 | 'selectors' => [ |
| 871 | 818 | '{{WRAPPER}} .elementor-image-carousel-caption' => 'text-align: {{VALUE}};', |
| 872 | 819 | ], |
| @@ -1013,9 +960,9 @@ | ||
| 1013 | 960 | if ( empty( $slides ) ) { |
| 1014 | 961 | return; |
| 1015 | 962 | } |
| 1016 | 963 | |
| 1017 | - $swiper_class = 'swiper'; | |
| 964 | + $swiper_class = Plugin::$instance->experiments->is_feature_active( 'e_swiper_latest' ) ? 'swiper' : 'swiper-container'; | |
| 1018 | 965 | $has_autoplay_enabled = 'yes' === $this->get_settings_for_display( 'autoplay' ); |
| 1019 | 966 | |
| 1020 | 967 | $this->add_render_attribute( [ |
| 1021 | 968 | 'carousel' => [ |
| @@ -1023,11 +970,8 @@ | ||
| 1023 | 970 | 'aria-live' => $has_autoplay_enabled ? 'off' : 'polite', |
| 1024 | 971 | ], |
| 1025 | 972 | 'carousel-wrapper' => [ |
| 1026 | 973 | 'class' => 'elementor-image-carousel-wrapper ' . $swiper_class, |
| 1027 | - 'role' => 'region', | |
| 1028 | - 'aria-roledescription' => 'carousel', | |
| 1029 | - 'aria-label' => $settings['carousel_name'], | |
| 1030 | 974 | 'dir' => $settings['direction'], |
| 1031 | 975 | ], |
| 1032 | 976 | ] ); |
| 1033 | 977 | |
| @@ -1068,9 +1012,9 @@ | ||
| 1068 | 1012 | * |
| 1069 | 1013 | * @since 1.0.0 |
| 1070 | 1014 | * @access private |
| 1071 | 1015 | * |
| 1072 | - * @param array $attachment | |
| 1016 | + * @param array $attachment | |
| 1073 | 1017 | * @param object $instance |
| 1074 | 1018 | * |
| 1075 | 1019 | * @return array|string|false An array/string containing the attachment URL, or false if no link. |
| 1076 | 1020 | */ |
| @@ -1141,26 +1085,6 @@ | ||
| 1141 | 1085 | ]; |
| 1142 | 1086 | } |
| 1143 | 1087 | |
| 1144 | 1088 | Icons_Manager::render_icon( $icon_settings, [ 'aria-hidden' => 'true' ] ); |
| 1145 | - } | |
| 1146 | - | |
| 1147 | - public function render_markdown(): string { | |
| 1148 | - $settings = $this->get_settings_for_display(); | |
| 1149 | - if ( empty( $settings['carousel'] ) ) { | |
| 1150 | - return ''; | |
| 1151 | - } | |
| 1152 | - $images = []; | |
| 1153 | - foreach ( $settings['carousel'] as $item ) { | |
| 1154 | - $url = $item['url'] ?? ''; | |
| 1155 | - if ( empty( $url ) ) { | |
| 1156 | - continue; | |
| 1157 | - } | |
| 1158 | - $alt = ''; | |
| 1159 | - if ( ! empty( $item['id'] ) ) { | |
| 1160 | - $alt = get_post_meta( $item['id'], '_wp_attachment_image_alt', true ); | |
| 1161 | - } | |
| 1162 | - $images[] = ' . ')'; | |
| 1163 | - } | |
| 1164 | - return implode( "\n\n", $images ); | |
| 1165 | 1089 | } |
| 1166 | 1090 | } |