File manager - Edit - /home/premiey/www/wp-includes/images/media/carousel.tar
Back
module.php 0000666 00000000552 15165735646 0006572 0 ustar 00 <?php namespace ElementorPro\Modules\Carousel; use ElementorPro\Base\Module_Base; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly } class Module extends Module_Base { public function get_widgets() { return [ 'Media_Carousel', 'Testimonial_Carousel', 'Reviews', ]; } public function get_name() { return 'carousel'; } } widgets/base.php 0000666 00000037354 15165735646 0007677 0 ustar 00 <?php namespace ElementorPro\Modules\Carousel\Widgets; use Elementor\Controls_Manager; use Elementor\Group_Control_Image_Size; use Elementor\Icons_Manager; use Elementor\Repeater; use ElementorPro\Base\Base_Widget; use ElementorPro\Plugin; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly } abstract class Base extends Base_Widget { private $slide_prints_count = 0; public function get_script_depends() { return [ 'imagesloaded' ]; } abstract protected function add_repeater_controls( Repeater $repeater ); abstract protected function get_repeater_defaults(); abstract protected function print_slide( array $slide, array $settings, $element_key ); protected function register_controls() { $this->start_controls_section( 'section_slides', [ 'label' => esc_html__( 'Slides', 'elementor-pro' ), 'tab' => Controls_Manager::TAB_CONTENT, ] ); $repeater = new Repeater(); $this->add_repeater_controls( $repeater ); $this->add_control( 'slides', [ 'label' => esc_html__( 'Slides', 'elementor-pro' ), 'type' => Controls_Manager::REPEATER, 'fields' => $repeater->get_controls(), 'default' => $this->get_repeater_defaults(), 'separator' => 'after', ] ); $this->add_control( 'effect', [ 'type' => Controls_Manager::SELECT, 'label' => esc_html__( 'Effect', 'elementor-pro' ), 'default' => 'slide', 'options' => [ 'slide' => esc_html__( 'Slide', 'elementor-pro' ), 'fade' => esc_html__( 'Fade', 'elementor-pro' ), 'cube' => esc_html__( 'Cube', 'elementor-pro' ), ], 'frontend_available' => true, ] ); $slides_per_view = range( 1, 10 ); $slides_per_view = array_combine( $slides_per_view, $slides_per_view ); $this->add_responsive_control( 'slides_per_view', [ 'type' => Controls_Manager::SELECT, 'label' => esc_html__( 'Slides Per View', 'elementor-pro' ), 'options' => [ '' => esc_html__( 'Default', 'elementor-pro' ) ] + $slides_per_view, 'inherit_placeholders' => false, 'condition' => [ 'effect' => 'slide', ], 'frontend_available' => true, ] ); $this->add_responsive_control( 'slides_to_scroll', [ 'type' => Controls_Manager::SELECT, 'label' => esc_html__( 'Slides to Scroll', 'elementor-pro' ), 'description' => esc_html__( 'Set how many slides are scrolled per swipe.', 'elementor-pro' ), 'options' => [ '' => esc_html__( 'Default', 'elementor-pro' ) ] + $slides_per_view, 'inherit_placeholders' => false, 'condition' => [ 'effect' => 'slide', ], 'frontend_available' => true, ] ); $this->add_responsive_control( 'height', [ 'type' => Controls_Manager::SLIDER, 'label' => esc_html__( 'Height', 'elementor-pro' ), 'size_units' => [ 'px', 'em', 'rem', 'vh', 'custom' ], 'range' => [ 'px' => [ 'min' => 100, 'max' => 1000, ], 'vh' => [ 'min' => 20, ], ], 'selectors' => [ '{{WRAPPER}} .elementor-main-swiper' => 'height: {{SIZE}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'width', [ 'type' => Controls_Manager::SLIDER, 'label' => esc_html__( 'Width', 'elementor-pro' ), 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ], 'range' => [ 'px' => [ 'min' => 100, 'max' => 1140, ], '%' => [ 'min' => 50, ], ], 'default' => [ 'unit' => '%', ], 'selectors' => [ '{{WRAPPER}} .elementor-main-swiper' => 'width: {{SIZE}}{{UNIT}};', ], ] ); $this->end_controls_section(); $this->start_controls_section( 'section_additional_options', [ 'label' => esc_html__( 'Additional Options', 'elementor-pro' ), ] ); $this->add_control( 'show_arrows', [ 'type' => Controls_Manager::SWITCHER, 'label' => esc_html__( 'Arrows', 'elementor-pro' ), 'default' => 'yes', 'label_off' => esc_html__( 'Hide', 'elementor-pro' ), 'label_on' => esc_html__( 'Show', 'elementor-pro' ), 'prefix_class' => 'elementor-arrows-', 'render_type' => 'template', 'frontend_available' => true, ] ); $this->add_control( 'pagination', [ 'label' => esc_html__( 'Pagination', 'elementor-pro' ), 'type' => Controls_Manager::SELECT, 'default' => 'bullets', 'options' => [ '' => esc_html__( 'None', 'elementor-pro' ), 'bullets' => esc_html__( 'Dots', 'elementor-pro' ), 'fraction' => esc_html__( 'Fraction', 'elementor-pro' ), 'progressbar' => esc_html__( 'Progress', 'elementor-pro' ), ], 'prefix_class' => 'elementor-pagination-type-', 'render_type' => 'template', 'frontend_available' => true, ] ); $this->add_control( 'speed', [ 'label' => esc_html__( 'Transition Duration', 'elementor-pro' ), 'type' => Controls_Manager::NUMBER, 'default' => 500, 'render_type' => 'none', 'frontend_available' => true, ] ); $this->add_control( 'autoplay', [ 'label' => esc_html__( 'Autoplay', 'elementor-pro' ), 'type' => Controls_Manager::SWITCHER, 'default' => 'yes', 'separator' => 'before', 'render_type' => 'none', 'frontend_available' => true, ] ); $this->add_control( 'autoplay_speed', [ 'label' => esc_html__( 'Autoplay Speed', 'elementor-pro' ), 'type' => Controls_Manager::NUMBER, 'default' => 5000, 'condition' => [ 'autoplay' => 'yes', ], 'render_type' => 'none', 'frontend_available' => true, ] ); $this->add_control( 'loop', [ 'label' => esc_html__( 'Infinite Loop', 'elementor-pro' ), 'type' => Controls_Manager::SWITCHER, 'default' => 'yes', 'frontend_available' => true, ] ); $this->add_control( 'pause_on_hover', [ 'label' => esc_html__( 'Pause on Hover', 'elementor-pro' ), 'type' => Controls_Manager::SWITCHER, 'default' => 'yes', 'condition' => [ 'autoplay' => 'yes', ], 'render_type' => 'none', 'frontend_available' => true, ] ); $this->add_control( 'pause_on_interaction', [ 'label' => esc_html__( 'Pause on Interaction', 'elementor-pro' ), 'type' => Controls_Manager::SWITCHER, 'default' => 'yes', 'condition' => [ 'autoplay' => 'yes', ], 'render_type' => 'none', 'frontend_available' => true, ] ); $this->add_group_control( Group_Control_Image_Size::get_type(), [ 'name' => 'image_size', 'default' => 'full', 'separator' => 'before', ] ); $this->add_control( 'lazyload', [ 'label' => esc_html__( 'Lazyload', 'elementor-pro' ), 'type' => Controls_Manager::SWITCHER, 'separator' => 'before', 'frontend_available' => true, ] ); $this->end_controls_section(); $this->start_controls_section( 'section_slides_style', [ 'label' => esc_html__( 'Slides', 'elementor-pro' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $space_between_config = [ 'label' => esc_html__( 'Space Between', 'elementor-pro' ), 'type' => Controls_Manager::SLIDER, 'range' => [ 'px' => [ 'max' => 50, ], ], 'render_type' => 'none', 'frontend_available' => true, ]; // TODO: Once Core 3.4.0 is out, get the active devices using Breakpoints/Manager::get_active_devices_list(). $active_breakpoint_instances = Plugin::elementor()->breakpoints->get_active_breakpoints(); // Devices need to be ordered from largest to smallest. $active_devices = array_reverse( array_keys( $active_breakpoint_instances ) ); // Add desktop in the correct position. if ( in_array( 'widescreen', $active_devices, true ) ) { $active_devices = array_merge( array_slice( $active_devices, 0, 1 ), [ 'desktop' ], array_slice( $active_devices, 1 ) ); } else { $active_devices = array_merge( [ 'desktop' ], $active_devices ); } foreach ( $active_devices as $active_device ) { $space_between_config[ $active_device . '_default' ] = [ 'size' => 10, ]; } $this->add_responsive_control( 'space_between', $space_between_config ); $this->add_control( 'slide_background_color', [ 'label' => esc_html__( 'Background Color', 'elementor-pro' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .elementor-main-swiper .swiper-slide' => 'background-color: {{VALUE}}', ], ] ); $this->add_control( 'slide_border_size', [ 'label' => esc_html__( 'Border Width', 'elementor-pro' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ], 'selectors' => [ '{{WRAPPER}} .elementor-main-swiper .swiper-slide' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}', ], ] ); $this->add_control( 'slide_border_radius', [ 'label' => esc_html__( 'Border Radius', 'elementor-pro' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', '%', 'em', 'rem', 'custom' ], 'range' => [ '%' => [ 'max' => 50, ], ], 'selectors' => [ '{{WRAPPER}} .elementor-main-swiper .swiper-slide' => 'border-radius: {{SIZE}}{{UNIT}}', ], ] ); $this->add_control( 'slide_border_color', [ 'label' => esc_html__( 'Border Color', 'elementor-pro' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .elementor-main-swiper .swiper-slide' => 'border-color: {{VALUE}}', ], ] ); $this->add_control( 'slide_padding', [ 'label' => esc_html__( 'Padding', 'elementor-pro' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ], 'selectors' => [ '{{WRAPPER}} .elementor-main-swiper .swiper-slide' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}', ], 'separator' => 'before', ] ); $this->end_controls_section(); $this->start_controls_section( 'section_navigation', [ 'label' => esc_html__( 'Navigation', 'elementor-pro' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'heading_arrows', [ 'label' => esc_html__( 'Arrows', 'elementor-pro' ), 'type' => Controls_Manager::HEADING, 'separator' => 'none', ] ); $this->add_control( 'arrows_size', [ 'label' => esc_html__( 'Size', 'elementor-pro' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', 'em', 'rem', 'custom' ], 'default' => [ 'size' => 20, ], 'range' => [ 'px' => [ 'min' => 10, ], ], 'selectors' => [ '{{WRAPPER}} .elementor-swiper-button' => 'font-size: {{SIZE}}{{UNIT}}', ], ] ); $this->add_control( 'arrows_color', [ 'label' => esc_html__( 'Color', 'elementor-pro' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .elementor-swiper-button' => 'color: {{VALUE}}', '{{WRAPPER}} .elementor-swiper-button svg' => 'fill: {{VALUE}}', ], ] ); $this->add_control( 'heading_pagination', [ 'label' => esc_html__( 'Pagination', 'elementor-pro' ), 'type' => Controls_Manager::HEADING, 'condition' => [ 'pagination!' => '', ], ] ); $this->add_control( 'pagination_position', [ 'label' => esc_html__( 'Position', 'elementor-pro' ), 'type' => Controls_Manager::SELECT, 'default' => 'outside', 'options' => [ 'outside' => esc_html__( 'Outside', 'elementor-pro' ), 'inside' => esc_html__( 'Inside', 'elementor-pro' ), ], 'prefix_class' => 'elementor-pagination-position-', 'condition' => [ 'pagination!' => '', ], ] ); $swiper_class = Plugin::elementor()->experiments->is_feature_active( 'e_swiper_latest' ) ? 'swiper' : 'swiper-container'; $this->add_control( 'pagination_size', [ 'label' => esc_html__( 'Size', 'elementor-pro' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', 'em', 'rem', 'custom' ], 'range' => [ 'px' => [ 'max' => 20, ], ], 'selectors' => [ '{{WRAPPER}} .swiper-pagination-bullet' => 'height: {{SIZE}}{{UNIT}}; width: {{SIZE}}{{UNIT}}', '{{WRAPPER}} .' . $swiper_class . '-horizontal .swiper-pagination-progressbar' => 'height: {{SIZE}}{{UNIT}}', '{{WRAPPER}} .swiper-pagination-fraction' => 'font-size: {{SIZE}}{{UNIT}}', ], 'condition' => [ 'pagination!' => '', ], ] ); $this->add_control( 'pagination_color_inactive', [ 'label' => esc_html__( 'Color', 'elementor-pro' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ // The opacity property will override the default inactive dot color which is opacity 0.2. '{{WRAPPER}} .swiper-pagination-bullet:not(.swiper-pagination-bullet-active)' => 'background-color: {{VALUE}}; opacity: 1;', ], 'condition' => [ 'pagination!' => '', ], ] ); $this->add_control( 'pagination_color', [ 'label' => esc_html__( 'Active Color', 'elementor-pro' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .swiper-pagination-bullet-active, {{WRAPPER}} .swiper-pagination-progressbar-fill' => 'background-color: {{VALUE}}', '{{WRAPPER}} .swiper-pagination-fraction' => 'color: {{VALUE}}', ], 'condition' => [ 'pagination!' => '', ], ] ); $this->end_controls_section(); } protected function print_slider( array $settings = null ) { if ( null === $settings ) { $settings = $this->get_settings_for_display(); } $default_settings = [ 'container_class' => 'elementor-main-swiper', 'video_play_icon' => true, ]; $settings = array_merge( $default_settings, $settings ); $slides_count = count( $settings['slides'] ); $swiper_class = Plugin::elementor()->experiments->is_feature_active( 'e_swiper_latest' ) ? 'swiper' : 'swiper-container'; ?> <div class="elementor-swiper"> <div class="<?php echo esc_attr( $settings['container_class'] ); ?> <?php echo esc_attr( $swiper_class ); ?>"> <div class="swiper-wrapper"> <?php foreach ( $settings['slides'] as $index => $slide ) : $this->slide_prints_count++; ?> <div class="swiper-slide"> <?php $this->print_slide( $slide, $settings, 'slide-' . $index . '-' . $this->slide_prints_count ); ?> </div> <?php endforeach; ?> </div> <?php if ( 1 < $slides_count ) : ?> <?php if ( $settings['pagination'] ) : ?> <div class="swiper-pagination"></div> <?php endif; ?> <?php if ( $settings['show_arrows'] ) : ?> <div class="elementor-swiper-button elementor-swiper-button-prev" role="button" tabindex="0"> <?php $this->render_swiper_button( 'previous' ); ?> <span class="elementor-screen-only"><?php echo esc_html__( 'Previous', 'elementor-pro' ); ?></span> </div> <div class="elementor-swiper-button elementor-swiper-button-next" role="button" tabindex="0"> <?php $this->render_swiper_button( 'next' ); ?> <span class="elementor-screen-only"><?php echo esc_html__( 'Next', 'elementor-pro' ); ?></span> </div> <?php endif; ?> <?php endif; ?> </div> </div> <?php } protected function get_slide_image_url( $slide, array $settings ) { $image_url = Group_Control_Image_Size::get_attachment_image_src( $slide['image']['id'], 'image_size', $settings ); if ( ! $image_url ) { $image_url = $slide['image']['url']; } return $image_url; } protected function get_slide_image_alt_attribute( $slide ) { if ( ! empty( $slide['name'] ) ) { return $slide['name']; } if ( ! empty( $slide['image']['alt'] ) ) { return $slide['image']['alt']; } return ''; } private function render_swiper_button( $type ) { $direction = 'next' === $type ? 'right' : 'left'; if ( is_rtl() ) { $direction = 'right' === $direction ? 'left' : 'right'; } $icon_value = 'eicon-chevron-' . $direction; Icons_Manager::render_icon( [ 'library' => 'eicons', 'value' => $icon_value, ], [ 'aria-hidden' => 'true' ] ); } } widgets/reviews.php 0000666 00000053616 15165735646 0010450 0 ustar 00 <?php namespace ElementorPro\Modules\Carousel\Widgets; use Elementor\Controls_Manager; use Elementor\Core\Kits\Documents\Tabs\Global_Typography; use Elementor\Group_Control_Typography; use Elementor\Icons_Manager; use Elementor\Repeater; use Elementor\Utils; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly } class Reviews extends Base { public function get_name() { return 'reviews'; } public function get_title() { return esc_html__( 'Reviews', 'elementor-pro' ); } public function get_icon() { return 'eicon-review'; } public function get_keywords() { return [ 'reviews', 'social', 'rating', 'testimonial', 'carousel' ]; } public function get_inline_css_depends() { $slides = $this->get_settings_for_display( 'slides' ); foreach ( $slides as $slide ) { if ( $slide['rating'] ) { return [ [ 'name' => 'star-rating', 'is_core_dependency' => true, ], ]; } } return []; } protected function register_controls() { parent::register_controls(); $this->update_control( 'slide_padding', [ 'selectors' => [ '{{WRAPPER}} .elementor-testimonial__header' => 'padding-top: {{TOP}}{{UNIT}}; padding-left: {{LEFT}}{{UNIT}}; padding-right: {{RIGHT}}{{UNIT}};', '{{WRAPPER}} .elementor-testimonial__content' => 'padding-bottom: {{BOTTOM}}{{UNIT}}; padding-left: {{LEFT}}{{UNIT}}; padding-right: {{RIGHT}}{{UNIT}};', ], ] ); $this->start_injection( [ 'of' => 'slide_padding', ] ); $this->add_control( 'heading_header', [ 'label' => esc_html__( 'Header', 'elementor-pro' ), 'type' => Controls_Manager::HEADING, 'separator' => 'before', ] ); $this->add_control( 'header_background_color', [ 'label' => esc_html__( 'Background Color', 'elementor-pro' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .elementor-testimonial__header' => 'background-color: {{VALUE}}', ], ] ); $this->add_responsive_control( 'content_gap', [ 'label' => esc_html__( 'Gap', 'elementor-pro' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', 'em', 'rem', 'custom' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 100, ], ], 'selectors' => [ '{{WRAPPER}} .elementor-testimonial__header' => 'padding-bottom: calc({{SIZE}}{{UNIT}} / 2)', '{{WRAPPER}} .elementor-testimonial__content' => 'padding-top: calc({{SIZE}}{{UNIT}} / 2)', ], ] ); $this->add_control( 'show_separator', [ 'label' => esc_html__( 'Separator', 'elementor-pro' ), 'type' => Controls_Manager::SWITCHER, 'label_off' => esc_html__( 'Hide', 'elementor-pro' ), 'label_on' => esc_html__( 'Show', 'elementor-pro' ), 'default' => 'has-separator', 'return_value' => 'has-separator', 'prefix_class' => 'elementor-review--', 'separator' => 'before', ] ); $this->add_control( 'separator_color', [ 'label' => esc_html__( 'Color', 'elementor-pro' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .elementor-testimonial__header' => 'border-bottom-color: {{VALUE}}', ], 'condition' => [ 'show_separator!' => '', ], ] ); $this->add_control( 'separator_size', [ 'label' => esc_html__( 'Size', 'elementor-pro' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', 'em', 'rem', 'custom' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 20, ], ], 'condition' => [ 'show_separator!' => '', ], 'selectors' => [ '{{WRAPPER}} .elementor-testimonial__header' => 'border-bottom-width: {{SIZE}}{{UNIT}}', ], ] ); $this->end_injection(); $this->start_injection( [ 'at' => 'before', 'of' => 'section_navigation', ] ); $this->start_controls_section( 'section_content_style', [ 'label' => esc_html__( 'Text', 'elementor-pro' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'name_title_style', [ 'label' => esc_html__( 'Name', 'elementor-pro' ), 'type' => Controls_Manager::HEADING, ] ); $this->add_control( 'name_color', [ 'label' => esc_html__( 'Color', 'elementor-pro' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .elementor-testimonial__name' => 'color: {{VALUE}}', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'name_typography', 'selector' => '{{WRAPPER}} .elementor-testimonial__header, {{WRAPPER}} .elementor-testimonial__name', 'global' => [ 'default' => Global_Typography::TYPOGRAPHY_PRIMARY, ], ] ); $this->add_control( 'heading_title_style', [ 'label' => esc_html__( 'Title', 'elementor-pro' ), 'type' => Controls_Manager::HEADING, 'separator' => 'before', ] ); $this->add_control( 'title_color', [ 'label' => esc_html__( 'Color', 'elementor-pro' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .elementor-testimonial__title' => 'color: {{VALUE}}', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'title_typography', 'selector' => '{{WRAPPER}} .elementor-testimonial__title', ] ); $this->add_control( 'heading_review_style', [ 'label' => esc_html__( 'Review', 'elementor-pro' ), 'type' => Controls_Manager::HEADING, 'separator' => 'before', ] ); $this->add_control( 'content_color', [ 'label' => esc_html__( 'Color', 'elementor-pro' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .elementor-testimonial__text' => 'color: {{VALUE}}', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'content_typography', 'selector' => '{{WRAPPER}} .elementor-testimonial__text', 'global' => [ 'default' => Global_Typography::TYPOGRAPHY_TEXT, ], ] ); $this->end_controls_section(); $this->start_controls_section( 'section_image_style', [ 'label' => esc_html__( 'Image', 'elementor-pro' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'image_size', [ 'label' => esc_html__( 'Size', 'elementor-pro' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', 'em', 'rem', 'custom' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 70, ], ], 'selectors' => [ '{{WRAPPER}} .elementor-testimonial__image img' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}}', ], ] ); $this->add_responsive_control( 'image_gap', [ 'label' => esc_html__( 'Gap', 'elementor-pro' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', 'em', 'rem', 'custom' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 100, ], ], 'selectors' => [ 'body:not(.rtl) {{WRAPPER}} .elementor-testimonial__image + cite' => 'margin-left: {{SIZE}}{{UNIT}}; margin-right: 0;', 'body.rtl {{WRAPPER}} .elementor-testimonial__image + cite' => 'margin-right: {{SIZE}}{{UNIT}}; margin-left:0;', ], ] ); $this->add_control( 'image_border_radius', [ 'label' => esc_html__( 'Border Radius', 'elementor-pro' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', '%', 'em', 'rem', 'custom' ], 'selectors' => [ '{{WRAPPER}} .elementor-testimonial__image img' => 'border-radius: {{SIZE}}{{UNIT}}', ], ] ); $this->end_controls_section(); $this->start_controls_section( 'section_icon_style', [ 'label' => esc_html__( 'Icon', 'elementor-pro' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'icon_color', [ 'label' => esc_html__( 'Color', 'elementor-pro' ), 'type' => Controls_Manager::SELECT, 'default' => 'default', 'options' => [ 'default' => esc_html__( 'Official', 'elementor-pro' ), 'custom' => esc_html__( 'Custom', 'elementor-pro' ), ], ] ); $this->add_control( 'icon_custom_color', [ 'label' => esc_html__( 'Color', 'elementor-pro' ), 'type' => Controls_Manager::COLOR, 'condition' => [ 'icon_color' => 'custom', ], 'selectors' => [ '{{WRAPPER}} .elementor-testimonial__icon:not(.elementor-testimonial__rating)' => 'color: {{VALUE}};', '{{WRAPPER}} .elementor-testimonial__icon:not(.elementor-testimonial__rating) svg' => 'fill: {{VALUE}};', ], ] ); $this->add_responsive_control( 'icon_size', [ 'label' => esc_html__( 'Size', 'elementor-pro' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', 'em', 'rem', 'custom' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 100, ], ], 'selectors' => [ '{{WRAPPER}} .elementor-testimonial__icon' => 'font-size: {{SIZE}}{{UNIT}}', '{{WRAPPER}} .elementor-testimonial__icon svg' => 'width: {{SIZE}}{{UNIT}}', ], ] ); $this->end_controls_section(); $this->start_controls_section( 'section_rating_style', [ 'label' => esc_html__( 'Rating', 'elementor-pro' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'star_style', [ 'label' => esc_html__( 'Icon', 'elementor-pro' ), 'type' => Controls_Manager::SELECT, 'options' => [ 'star_fontawesome' => 'Font Awesome', 'star_unicode' => 'Unicode', ], 'default' => 'star_fontawesome', 'render_type' => 'template', 'prefix_class' => 'elementor--star-style-', 'separator' => 'before', ] ); $this->add_control( 'unmarked_star_style', [ 'label' => esc_html__( 'Unmarked Style', 'elementor-pro' ), 'type' => Controls_Manager::CHOOSE, 'options' => [ 'solid' => [ 'title' => esc_html__( 'Solid', 'elementor-pro' ), 'icon' => 'eicon-star', ], 'outline' => [ 'title' => esc_html__( 'Outline', 'elementor-pro' ), 'icon' => 'eicon-star-o', ], ], 'default' => 'solid', ] ); $this->add_control( 'star_size', [ 'label' => esc_html__( 'Size', 'elementor-pro' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', 'em', 'rem', 'custom' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 100, ], ], 'selectors' => [ '{{WRAPPER}} .elementor-star-rating' => 'font-size: {{SIZE}}{{UNIT}}', ], 'separator' => 'before', ] ); $this->add_control( 'star_space', [ 'label' => esc_html__( 'Spacing', 'elementor-pro' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', 'em', 'rem', 'custom' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 50, ], ], 'selectors' => [ 'body:not(.rtl) {{WRAPPER}} .elementor-star-rating i:not(:last-of-type)' => 'margin-right: {{SIZE}}{{UNIT}}', 'body.rtl {{WRAPPER}} .elementor-star-rating i:not(:last-of-type)' => 'margin-left: {{SIZE}}{{UNIT}}', ], ] ); $this->add_control( 'stars_color', [ 'label' => esc_html__( 'Color', 'elementor-pro' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .elementor-star-rating i:before' => 'color: {{VALUE}}', ], 'separator' => 'before', ] ); $this->add_control( 'stars_unmarked_color', [ 'label' => esc_html__( 'Unmarked Color', 'elementor-pro' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .elementor-star-rating i' => 'color: {{VALUE}}', ], ] ); $this->end_controls_section(); $this->end_injection(); $this->update_responsive_control( 'width', [ 'selectors' => [ '{{WRAPPER}}.elementor-arrows-yes .elementor-main-swiper' => 'width: calc( {{SIZE}}{{UNIT}} - 40px )', '{{WRAPPER}} .elementor-main-swiper' => 'width: {{SIZE}}{{UNIT}}', ], ] ); $this->update_responsive_control( 'slides_per_view', [ 'condition' => null, ] ); $this->update_control( 'slides_to_scroll', [ 'condition' => null, ] ); $this->remove_control( 'effect' ); $this->remove_responsive_control( 'height' ); $this->remove_control( 'pagination_position' ); } protected function add_repeater_controls( Repeater $repeater ) { $repeater->add_control( 'image', [ 'label' => esc_html__( 'Image', 'elementor-pro' ), 'type' => Controls_Manager::MEDIA, 'default' => [ 'url' => Utils::get_placeholder_image_src(), ], 'dynamic' => [ 'active' => true, ], ] ); $repeater->add_control( 'name', [ 'label' => esc_html__( 'Name', 'elementor-pro' ), 'type' => Controls_Manager::TEXT, 'default' => esc_html__( 'John Doe', 'elementor-pro' ), 'dynamic' => [ 'active' => true, ], ] ); $repeater->add_control( 'title', [ 'label' => esc_html__( 'Title', 'elementor-pro' ), 'type' => Controls_Manager::TEXT, 'default' => '@username', 'dynamic' => [ 'active' => true, ], ] ); $repeater->add_control( 'rating', [ 'label' => esc_html__( 'Rating', 'elementor-pro' ), 'type' => Controls_Manager::NUMBER, 'min' => 0, 'max' => 5, 'step' => 0.1, 'dynamic' => [ 'active' => true, ], ] ); $repeater->add_control( 'selected_social_icon', [ 'label' => esc_html__( 'Icon', 'elementor-pro' ), 'type' => Controls_Manager::ICONS, 'fa4compatibility' => 'social_icon', 'default' => [ 'value' => 'fab fa-twitter', 'library' => 'fa-brands', ], 'recommended' => [ 'fa-solid' => [ 'rss', 'shopping-cart', 'thumbtack', ], 'fa-brands' => [ 'android', 'apple', 'behance', 'bitbucket', 'codepen', 'delicious', 'digg', 'dribbble', 'envelope', 'facebook', 'flickr', 'foursquare', 'github', 'google-plus', 'houzz', 'instagram', 'jsfiddle', 'linkedin', 'medium', 'meetup', 'mix', 'mixcloud', 'odnoklassniki', 'pinterest', 'product-hunt', 'reddit', 'skype', 'slideshare', 'snapchat', 'soundcloud', 'spotify', 'stack-overflow', 'steam', 'telegram', 'tripadvisor', 'tumblr', 'twitch', 'twitter', 'vimeo', 'fa-vk', 'weibo', 'weixin', 'whatsapp', 'wordpress', 'xing', 'yelp', 'youtube', '500px', ], ], ] ); $repeater->add_control( 'link', [ 'label' => esc_html__( 'Link', 'elementor-pro' ), 'type' => Controls_Manager::URL, 'dynamic' => [ 'active' => true, ], 'placeholder' => esc_html__( 'https://your-link.com', 'elementor-pro' ), ] ); $repeater->add_control( 'content', [ 'label' => esc_html__( 'Review', 'elementor-pro' ), 'type' => Controls_Manager::TEXTAREA, 'default' => esc_html__( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.', 'elementor-pro' ), 'dynamic' => [ 'active' => true, ], ] ); } protected function get_repeater_defaults() { $placeholder_image_src = Utils::get_placeholder_image_src(); return [ [ 'content' => esc_html__( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.', 'elementor-pro' ), 'name' => esc_html__( 'John Doe', 'elementor-pro' ), 'title' => '@username', 'image' => [ 'url' => $placeholder_image_src, ], ], [ 'content' => esc_html__( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.', 'elementor-pro' ), 'name' => esc_html__( 'John Doe', 'elementor-pro' ), 'title' => '@username', 'image' => [ 'url' => $placeholder_image_src, ], ], [ 'content' => esc_html__( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.', 'elementor-pro' ), 'name' => esc_html__( 'John Doe', 'elementor-pro' ), 'title' => '@username', 'image' => [ 'url' => $placeholder_image_src, ], ], ]; } private function print_cite( $slide, $settings ) { if ( empty( $slide['name'] ) && empty( $slide['title'] ) ) { return ''; } $html = '<cite class="elementor-testimonial__cite">'; if ( ! empty( $slide['name'] ) ) { $html .= '<span class="elementor-testimonial__name">' . $slide['name'] . '</span>'; } if ( ! empty( $slide['rating'] ) ) { $html .= $this->render_stars( $slide, $settings ); } if ( ! empty( $slide['title'] ) ) { $html .= '<span class="elementor-testimonial__title">' . $slide['title'] . '</span>'; } $html .= '</cite>'; echo wp_kses_post( $html ); } protected function render_stars( $slide, $settings ) { $icon = ''; if ( 'star_fontawesome' === $settings['star_style'] ) { if ( 'outline' === $settings['unmarked_star_style'] ) { $icon = ''; } } elseif ( 'star_unicode' === $settings['star_style'] ) { $icon = '★'; if ( 'outline' === $settings['unmarked_star_style'] ) { $icon = '☆'; } } $rating = (float) $slide['rating'] > 5 ? 5 : $slide['rating']; $floored_rating = (int) $rating; $stars_html = ''; for ( $stars = 1; $stars <= 5; $stars++ ) { if ( $stars <= $floored_rating ) { $stars_html .= '<i class="elementor-star-full">' . $icon . '</i>'; } elseif ( $floored_rating + 1 === $stars && $rating !== $floored_rating ) { $stars_html .= '<i class="elementor-star-' . ( $rating - $floored_rating ) * 10 . '">' . $icon . '</i>'; } else { $stars_html .= '<i class="elementor-star-empty">' . $icon . '</i>'; } } return '<div class="elementor-star-rating">' . $stars_html . '</div>'; } private function print_icon( $slide, $element_key ) { $migration_allowed = Icons_Manager::is_migration_allowed(); if ( ! isset( $slide['social_icon'] ) && ! $migration_allowed ) { // add old default $slide['social_icon'] = 'fa fa-twitter'; } if ( empty( $slide['social_icon'] ) && empty( $slide['selected_social_icon'] ) ) { return ''; } $migrated = isset( $slide['__fa4_migrated']['selected_social_icon'] ); $is_new = empty( $slide['social_icon'] ) && $migration_allowed; $social = ''; if ( $is_new || $migrated ) { ob_start(); Icons_Manager::render_icon( $slide['selected_social_icon'], [ 'aria-hidden' => 'true' ] ); $icon = ob_get_clean(); } else { $icon = '<i class="' . esc_attr( $slide['social_icon'] ) . '" aria-hidden="true"></i>'; } if ( ! empty( $slide['social_icon'] ) ) { $social = str_replace( 'fa fa-', '', $slide['social_icon'] ); } if ( ( $is_new || $migrated ) && 'svg' !== $slide['selected_social_icon']['library'] ) { $social = explode( ' ', $slide['selected_social_icon']['value'], 2 ); if ( empty( $social[1] ) ) { $social = ''; } else { $social = str_replace( 'fa-', '', $social[1] ); } } if ( 'svg' === $slide['selected_social_icon']['library'] ) { $social = ''; } $this->add_render_attribute( 'icon_wrapper_' . $element_key, 'class', 'elementor-testimonial__icon elementor-icon' ); $icon .= '<span class="elementor-screen-only">' . esc_html__( 'Read More', 'elementor-pro' ) . '</span>'; $this->add_render_attribute( 'icon_wrapper_' . $element_key, 'class', 'elementor-icon-' . $social ); // Icon is escaped above, get_render_attribute_string() is safe echo '<div ' . $this->get_render_attribute_string( 'icon_wrapper_' . $element_key ) . '>' . $icon . '</div>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } protected function print_slide( array $slide, array $settings, $element_key ) { $lazyload = 'yes' === $this->get_settings( 'lazyload' ); $this->add_render_attribute( $element_key . '-testimonial', [ 'class' => 'elementor-testimonial', ] ); $this->add_render_attribute( $element_key . '-testimonial', [ 'class' => 'elementor-repeater-item-' . $slide['_id'], ] ); if ( ! empty( $slide['image']['url'] ) ) { $img_src = $this->get_slide_image_url( $slide, $settings ); if ( $lazyload ) { $img_attribute['class'] = 'swiper-lazy'; $img_attribute['data-src'] = $img_src; } else { $img_attribute['src'] = $img_src; } $img_attribute['alt'] = $this->get_slide_image_alt_attribute( $slide ); $this->add_render_attribute( $element_key . '-image', $img_attribute ); } ?> <div <?php $this->print_render_attribute_string( $element_key . '-testimonial' ); ?>> <?php if ( $slide['image']['url'] || ! empty( $slide['name'] ) || ! empty( $slide['title'] ) ) : $link_url = empty( $slide['link']['url'] ) ? false : $slide['link']['url']; $header_tag = ! empty( $link_url ) ? 'a' : 'div'; $header_element = 'header_' . $slide['_id']; $this->add_render_attribute( $header_element, 'class', 'elementor-testimonial__header' ); if ( ! empty( $link_url ) ) { $this->add_link_attributes( $header_element, $slide['link'] ); } ?> <<?php Utils::print_validated_html_tag( $header_tag ); ?> <?php $this->print_render_attribute_string( $header_element ); ?>> <?php if ( $slide['image']['url'] ) : ?> <div class="elementor-testimonial__image"> <img <?php $this->print_render_attribute_string( $element_key . '-image' ); ?>> <?php if ( $lazyload ) : ?> <div class="swiper-lazy-preloader"></div> <?php endif; ?> </div> <?php endif; ?> <?php $this->print_cite( $slide, $settings ); ?> <?php $this->print_icon( $slide, $element_key ); ?> </<?php Utils::print_validated_html_tag( $header_tag ); ?>> <?php endif; ?> <?php if ( $slide['content'] ) : ?> <div class="elementor-testimonial__content"> <div class="elementor-testimonial__text"> <?php // Main content allowed echo $slide['content']; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> </div> </div> <?php endif; ?> </div> <?php } protected function render() { $this->print_slider(); } public function get_group_name() { return 'carousel'; } } widgets/testimonial-carousel.php 0000666 00000053371 15165735646 0013125 0 ustar 00 <?php namespace ElementorPro\Modules\Carousel\Widgets; use Elementor\Controls_Manager; use Elementor\Core\Kits\Documents\Tabs\Global_Colors; use Elementor\Core\Kits\Documents\Tabs\Global_Typography; use Elementor\Group_Control_Typography; use Elementor\Group_Control_Text_Stroke; use Elementor\Repeater; use Elementor\Utils; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly } class Testimonial_Carousel extends Base { public function get_name() { return 'testimonial-carousel'; } public function get_title() { return esc_html__( 'Testimonial Carousel', 'elementor-pro' ); } public function get_icon() { return 'eicon-testimonial-carousel'; } public function get_keywords() { return [ 'testimonial', 'carousel', 'image' ]; } protected function register_controls() { parent::register_controls(); $this->start_injection( [ 'of' => 'slides', ] ); $this->add_control( 'skin', [ 'label' => esc_html__( 'Skin', 'elementor-pro' ), 'type' => Controls_Manager::SELECT, 'default' => 'default', 'options' => [ 'default' => esc_html__( 'Default', 'elementor-pro' ), 'bubble' => esc_html__( 'Bubble', 'elementor-pro' ), ], 'prefix_class' => 'elementor-testimonial--skin-', 'render_type' => 'template', ] ); $this->add_control( 'layout', [ 'label' => esc_html__( 'Layout', 'elementor-pro' ), 'type' => Controls_Manager::SELECT, 'default' => 'image_inline', 'options' => [ 'image_inline' => esc_html__( 'Image Inline', 'elementor-pro' ), 'image_stacked' => esc_html__( 'Image Stacked', 'elementor-pro' ), 'image_above' => esc_html__( 'Image Above', 'elementor-pro' ), 'image_left' => esc_html__( 'Image Left', 'elementor-pro' ), 'image_right' => esc_html__( 'Image Right', 'elementor-pro' ), ], 'prefix_class' => 'elementor-testimonial--layout-', 'render_type' => 'template', ] ); $this->add_responsive_control( 'alignment', [ 'label' => esc_html__( 'Alignment', 'elementor-pro' ), 'type' => Controls_Manager::CHOOSE, 'default' => 'center', 'options' => [ 'left' => [ 'title' => esc_html__( 'Left', 'elementor-pro' ), 'icon' => 'eicon-text-align-left', ], 'center' => [ 'title' => esc_html__( 'Center', 'elementor-pro' ), 'icon' => 'eicon-text-align-center', ], 'right' => [ 'title' => esc_html__( 'Right', 'elementor-pro' ), 'icon' => 'eicon-text-align-right', ], ], 'prefix_class' => 'elementor-testimonial-%s-align-', ] ); $this->end_injection(); $this->start_controls_section( 'section_skin_style', [ 'label' => esc_html__( 'Bubble', 'elementor-pro' ), 'tab' => Controls_Manager::TAB_STYLE, 'condition' => [ 'skin' => 'bubble', ], ] ); $this->add_control( 'background_color', [ 'label' => esc_html__( 'Background Color', 'elementor-pro' ), 'type' => Controls_Manager::COLOR, 'alpha' => false, 'selectors' => [ '{{WRAPPER}} .elementor-testimonial__content, {{WRAPPER}} .elementor-testimonial__content:after' => 'background-color: {{VALUE}}', ], ] ); $this->add_responsive_control( 'text_padding', [ 'label' => esc_html__( 'Padding', 'elementor-pro' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ], 'default' => [ 'top' => '20', 'bottom' => '20', 'left' => '20', 'right' => '20', 'unit' => 'px', ], 'selectors' => [ '{{WRAPPER}} .elementor-testimonial__content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}', '{{WRAPPER}}.elementor-testimonial--layout-image_left .elementor-testimonial__footer, {{WRAPPER}}.elementor-testimonial--layout-image_right .elementor-testimonial__footer' => 'padding-top: {{TOP}}{{UNIT}}', '{{WRAPPER}}.elementor-testimonial--layout-image_above .elementor-testimonial__footer, {{WRAPPER}}.elementor-testimonial--layout-image_inline .elementor-testimonial__footer, {{WRAPPER}}.elementor-testimonial--layout-image_stacked .elementor-testimonial__footer' => 'padding: 0 {{RIGHT}}{{UNIT}} 0 {{LEFT}}{{UNIT}}', ], ] ); $this->add_responsive_control( 'border_radius', [ 'label' => esc_html__( 'Border Radius', 'elementor-pro' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em', 'rem', 'custom' ], 'selectors' => [ '{{WRAPPER}} .elementor-testimonial__content' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_control( 'border', [ 'label' => esc_html__( 'Border', 'elementor-pro' ), 'type' => Controls_Manager::SWITCHER, 'selectors' => [ '{{WRAPPER}} .elementor-testimonial__content, {{WRAPPER}} .elementor-testimonial__content:after' => 'border-style: solid', ], ] ); $this->add_control( 'border_color', [ 'label' => esc_html__( 'Border Color', 'elementor-pro' ), 'type' => Controls_Manager::COLOR, 'default' => '#000', 'selectors' => [ '{{WRAPPER}} .elementor-testimonial__content' => 'border-color: {{VALUE}}', '{{WRAPPER}} .elementor-testimonial__content:after' => 'border-color: transparent {{VALUE}} {{VALUE}} transparent', ], 'condition' => [ 'border' => 'yes', ], ] ); $this->add_responsive_control( 'border_width', [ 'label' => esc_html__( 'Border Width', 'elementor-pro' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ], 'range' => [ 'px' => [ 'max' => 20, ], 'em' => [ 'max' => 2, ], ], 'selectors' => [ '{{WRAPPER}} .elementor-testimonial__content, {{WRAPPER}} .elementor-testimonial__content:after' => 'border-width: {{SIZE}}{{UNIT}}', '{{WRAPPER}}.elementor-testimonial--layout-image_stacked .elementor-testimonial__content:after, {{WRAPPER}}.elementor-testimonial--layout-image_inline .elementor-testimonial__content:after' => 'margin-top: -{{SIZE}}{{UNIT}}', '{{WRAPPER}}.elementor-testimonial--layout-image_above .elementor-testimonial__content:after' => 'margin-bottom: -{{SIZE}}{{UNIT}}', ], 'condition' => [ 'border' => 'yes', ], ] ); $this->end_controls_section(); $this->start_injection( [ 'at' => 'before', 'of' => 'section_navigation', ] ); $this->start_controls_section( 'section_content_style', [ 'label' => esc_html__( 'Content', 'elementor-pro' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_responsive_control( 'content_gap', [ 'label' => esc_html__( 'Gap', 'elementor-pro' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', 'em', 'rem', 'custom' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 100, ], ], 'selectors' => [ '{{WRAPPER}}.elementor-testimonial--layout-image_inline .elementor-testimonial__footer, {{WRAPPER}}.elementor-testimonial--layout-image_stacked .elementor-testimonial__footer' => 'margin-top: {{SIZE}}{{UNIT}}', '{{WRAPPER}}.elementor-testimonial--layout-image_above .elementor-testimonial__footer' => 'margin-bottom: {{SIZE}}{{UNIT}}', '{{WRAPPER}}.elementor-testimonial--layout-image_left .elementor-testimonial__footer' => 'padding-right: {{SIZE}}{{UNIT}}', '{{WRAPPER}}.elementor-testimonial--layout-image_right .elementor-testimonial__footer' => 'padding-left: {{SIZE}}{{UNIT}}', ], ] ); $this->add_control( 'content_color', [ 'label' => esc_html__( 'Text Color', 'elementor-pro' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .elementor-testimonial__text' => 'color: {{VALUE}}', ], 'global' => [ 'default' => Global_Colors::COLOR_TEXT, ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'content_typography', 'selector' => '{{WRAPPER}} .elementor-testimonial__text', 'global' => [ 'default' => Global_Typography::TYPOGRAPHY_TEXT, ], ] ); $this->add_group_control( Group_Control_Text_Stroke::get_type(), [ 'name' => 'text_stroke', 'selector' => '{{WRAPPER}} .elementor-testimonial__text', ] ); $this->add_control( 'name_title_style', [ 'label' => esc_html__( 'Name', 'elementor-pro' ), 'type' => Controls_Manager::HEADING, 'separator' => 'before', ] ); $this->add_control( 'name_color', [ 'label' => esc_html__( 'Text Color', 'elementor-pro' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .elementor-testimonial__name' => 'color: {{VALUE}}', ], 'global' => [ 'default' => Global_Colors::COLOR_TEXT, ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'name_typography', 'selector' => '{{WRAPPER}} .elementor-testimonial__name', 'global' => [ 'default' => Global_Typography::TYPOGRAPHY_PRIMARY, ], ] ); $this->add_control( 'heading_title_style', [ 'label' => esc_html__( 'Title', 'elementor-pro' ), 'type' => Controls_Manager::HEADING, 'separator' => 'before', ] ); $this->add_control( 'title_color', [ 'label' => esc_html__( 'Text Color', 'elementor-pro' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .elementor-testimonial__title' => 'color: {{VALUE}}', ], 'global' => [ 'default' => Global_Colors::COLOR_PRIMARY, ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'title_typography', 'selector' => '{{WRAPPER}} .elementor-testimonial__title', 'global' => [ 'default' => Global_Typography::TYPOGRAPHY_SECONDARY, ], ] ); $this->end_controls_section(); $this->start_controls_section( 'section_image_style', [ 'label' => esc_html__( 'Image', 'elementor-pro' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_responsive_control( 'image_size', [ 'label' => esc_html__( 'Size', 'elementor-pro' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', 'em', 'rem', 'custom' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 200, ], ], 'selectors' => [ '{{WRAPPER}} .elementor-testimonial__image img' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}}', '{{WRAPPER}}.elementor-testimonial--layout-image_left .elementor-testimonial__content:after, {{WRAPPER}}.elementor-testimonial--layout-image_right .elementor-testimonial__content:after' => 'top: calc( {{text_padding.TOP}}{{text_padding.UNIT}} + ({{SIZE}}{{UNIT}} / 2) - 8px );', 'body:not(.rtl) {{WRAPPER}}.elementor-testimonial--layout-image_stacked:not(.elementor-testimonial--align-center):not(.elementor-testimonial--align-right) .elementor-testimonial__content:after, body:not(.rtl) {{WRAPPER}}.elementor-testimonial--layout-image_inline:not(.elementor-testimonial--align-center):not(.elementor-testimonial--align-right) .elementor-testimonial__content:after, {{WRAPPER}}.elementor-testimonial--layout-image_stacked.elementor-testimonial--align-left .elementor-testimonial__content:after, {{WRAPPER}}.elementor-testimonial--layout-image_inline.elementor-testimonial--align-left .elementor-testimonial__content:after' => 'left: calc( {{text_padding.LEFT}}{{text_padding.UNIT}} + ({{SIZE}}{{UNIT}} / 2) - 8px ); right:auto;', 'body.rtl {{WRAPPER}}.elementor-testimonial--layout-image_stacked:not(.elementor-testimonial--align-center):not(.elementor-testimonial--align-left) .elementor-testimonial__content:after, body.rtl {{WRAPPER}}.elementor-testimonial--layout-image_inline:not(.elementor-testimonial--align-center):not(.elementor-testimonial--align-left) .elementor-testimonial__content:after, {{WRAPPER}}.elementor-testimonial--layout-image_stacked.elementor-testimonial--align-right .elementor-testimonial__content:after, {{WRAPPER}}.elementor-testimonial--layout-image_inline.elementor-testimonial--align-right .elementor-testimonial__content:after' => 'right: calc( {{text_padding.RIGHT}}{{text_padding.UNIT}} + ({{SIZE}}{{UNIT}} / 2) - 8px ); left:auto;', 'body:not(.rtl) {{WRAPPER}}.elementor-testimonial--layout-image_above:not(.elementor-testimonial--align-center):not(.elementor-testimonial--align-right) .elementor-testimonial__content:after, {{WRAPPER}}.elementor-testimonial--layout-image_above.elementor-testimonial--align-left .elementor-testimonial__content:after' => 'left: calc( {{text_padding.LEFT}}{{text_padding.UNIT}} + ({{SIZE}}{{UNIT}} / 2) - 8px ); right:auto;', 'body.rtl {{WRAPPER}}.elementor-testimonial--layout-image_above:not(.elementor-testimonial--align-center):not(.elementor-testimonial--align-left) .elementor-testimonial__content:after, {{WRAPPER}}.elementor-testimonial--layout-image_above.elementor-testimonial--align-right .elementor-testimonial__content:after' => 'right: calc( {{text_padding.RIGHT}}{{text_padding.UNIT}} + ({{SIZE}}{{UNIT}} / 2) - 8px ); left:auto;', ], ] ); $this->add_responsive_control( 'image_gap', [ 'label' => esc_html__( 'Gap', 'elementor-pro' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', 'em', 'rem', 'custom' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 100, ], ], 'selectors' => [ 'body.rtl {{WRAPPER}}.elementor-testimonial--layout-image_inline.elementor-testimonial--align-left .elementor-testimonial__image + cite, body.rtl {{WRAPPER}}.elementor-testimonial--layout-image_above.elementor-testimonial--align-left .elementor-testimonial__image + cite, body:not(.rtl) {{WRAPPER}}.elementor-testimonial--layout-image_inline .elementor-testimonial__image + cite, body:not(.rtl) {{WRAPPER}}.elementor-testimonial--layout-image_above .elementor-testimonial__image + cite' => 'margin-left: {{SIZE}}{{UNIT}}; margin-right: 0;', 'body:not(.rtl) {{WRAPPER}}.elementor-testimonial--layout-image_inline.elementor-testimonial--align-right .elementor-testimonial__image + cite, body:not(.rtl) {{WRAPPER}}.elementor-testimonial--layout-image_above.elementor-testimonial--align-right .elementor-testimonial__image + cite, body.rtl {{WRAPPER}}.elementor-testimonial--layout-image_inline .elementor-testimonial__image + cite, body.rtl {{WRAPPER}}.elementor-testimonial--layout-image_above .elementor-testimonial__image + cite' => 'margin-right: {{SIZE}}{{UNIT}}; margin-left:0;', '{{WRAPPER}}.elementor-testimonial--layout-image_stacked .elementor-testimonial__image + cite, {{WRAPPER}}.elementor-testimonial--layout-image_left .elementor-testimonial__image + cite, {{WRAPPER}}.elementor-testimonial--layout-image_right .elementor-testimonial__image + cite' => 'margin-top: {{SIZE}}{{UNIT}}', ], ] ); $this->add_control( 'image_border', [ 'label' => esc_html__( 'Border', 'elementor-pro' ), 'type' => Controls_Manager::SWITCHER, 'selectors' => [ '{{WRAPPER}} .elementor-testimonial__image img' => 'border-style: solid', ], ] ); $this->add_control( 'image_border_color', [ 'label' => esc_html__( 'Border Color', 'elementor-pro' ), 'type' => Controls_Manager::COLOR, 'default' => '#000', 'selectors' => [ '{{WRAPPER}} .elementor-testimonial__image img' => 'border-color: {{VALUE}}', ], 'condition' => [ 'image_border' => 'yes', ], ] ); $this->add_responsive_control( 'image_border_width', [ 'label' => esc_html__( 'Border Width', 'elementor-pro' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ], 'range' => [ 'px' => [ 'max' => 20, ], 'em' => [ 'max' => 2, ], ], 'selectors' => [ '{{WRAPPER}} .elementor-testimonial__image img' => 'border-width: {{SIZE}}{{UNIT}}', ], 'condition' => [ 'image_border' => 'yes', ], ] ); $this->add_control( 'image_border_radius', [ 'label' => esc_html__( 'Border Radius', 'elementor-pro' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', '%', 'em', 'rem', 'custom' ], 'selectors' => [ '{{WRAPPER}} .elementor-testimonial__image img' => 'border-radius: {{SIZE}}{{UNIT}}', ], ] ); $this->end_controls_section(); $this->end_injection(); $this->update_responsive_control( 'width', [ 'selectors' => [ '{{WRAPPER}}.elementor-arrows-yes .elementor-main-swiper' => 'width: calc( {{SIZE}}{{UNIT}} - 40px )', '{{WRAPPER}} .elementor-main-swiper' => 'width: {{SIZE}}{{UNIT}}', ], ] ); $this->update_responsive_control( 'slides_per_view', [ 'condition' => null, ] ); $this->update_responsive_control( 'slides_to_scroll', [ 'condition' => null, ] ); $this->remove_control( 'effect' ); $this->remove_responsive_control( 'height' ); $this->remove_control( 'pagination_position' ); } protected function add_repeater_controls( Repeater $repeater ) { $repeater->add_control( 'content', [ 'label' => esc_html__( 'Content', 'elementor-pro' ), 'type' => Controls_Manager::TEXTAREA, 'dynamic' => [ 'active' => true, ], ] ); $repeater->add_control( 'image', [ 'label' => esc_html__( 'Image', 'elementor-pro' ), 'type' => Controls_Manager::MEDIA, 'dynamic' => [ 'active' => true, ], ] ); $repeater->add_control( 'name', [ 'label' => esc_html__( 'Name', 'elementor-pro' ), 'type' => Controls_Manager::TEXT, 'default' => esc_html__( 'John Doe', 'elementor-pro' ), 'dynamic' => [ 'active' => true, ], ] ); $repeater->add_control( 'title', [ 'label' => esc_html__( 'Title', 'elementor-pro' ), 'type' => Controls_Manager::TEXT, 'default' => esc_html__( 'CEO', 'elementor-pro' ), 'dynamic' => [ 'active' => true, ], ] ); } protected function get_repeater_defaults() { $placeholder_image_src = Utils::get_placeholder_image_src(); return [ [ 'content' => esc_html__( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.', 'elementor-pro' ), 'name' => esc_html__( 'John Doe', 'elementor-pro' ), 'title' => esc_html__( 'CEO', 'elementor-pro' ), 'image' => [ 'url' => $placeholder_image_src, ], ], [ 'content' => esc_html__( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.', 'elementor-pro' ), 'name' => esc_html__( 'John Doe', 'elementor-pro' ), 'title' => esc_html__( 'CEO', 'elementor-pro' ), 'image' => [ 'url' => $placeholder_image_src, ], ], [ 'content' => esc_html__( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.', 'elementor-pro' ), 'name' => esc_html__( 'John Doe', 'elementor-pro' ), 'title' => esc_html__( 'CEO', 'elementor-pro' ), 'image' => [ 'url' => $placeholder_image_src, ], ], ]; } private function print_cite( $slide, $location ) { if ( empty( $slide['name'] ) && empty( $slide['title'] ) ) { return ''; } $skin = $this->get_settings( 'skin' ); $layout = 'bubble' === $skin ? 'image_inline' : $this->get_settings( 'layout' ); $locations_outside = [ 'image_above', 'image_right', 'image_left' ]; $locations_inside = [ 'image_inline', 'image_stacked' ]; $print_outside = ( 'outside' === $location && in_array( $layout, $locations_outside ) ); $print_inside = ( 'inside' === $location && in_array( $layout, $locations_inside ) ); $html = ''; if ( $print_outside || $print_inside ) { $html = '<cite class="elementor-testimonial__cite">'; if ( ! empty( $slide['name'] ) ) { $html .= '<span class="elementor-testimonial__name">' . $slide['name'] . '</span>'; } if ( ! empty( $slide['title'] ) ) { $html .= '<span class="elementor-testimonial__title">' . $slide['title'] . '</span>'; } $html .= '</cite>'; } // PHPCS - the main text of a widget should not be escaped. echo $html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } protected function print_slide( array $slide, array $settings, $element_key ) { $lazyload = 'yes' === $this->get_settings( 'lazyload' ); $this->add_render_attribute( $element_key . '-testimonial', [ 'class' => 'elementor-testimonial', ] ); if ( ! empty( $slide['image']['url'] ) ) { $img_src = $this->get_slide_image_url( $slide, $settings ); if ( $lazyload ) { $img_attribute['class'] = 'swiper-lazy'; $img_attribute['data-src'] = $img_src; } else { $img_attribute['src'] = $img_src; } $img_attribute['alt'] = $this->get_slide_image_alt_attribute( $slide ); $this->add_render_attribute( $element_key . '-image', $img_attribute ); } ?> <div <?php $this->print_render_attribute_string( $element_key . '-testimonial' ); ?>> <?php if ( $slide['content'] ) : ?> <div class="elementor-testimonial__content"> <div class="elementor-testimonial__text"> <?php // PHPCS - the main text of a widget should not be escaped. echo $slide['content']; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> </div> <?php $this->print_cite( $slide, 'outside' ); ?> </div> <?php endif; ?> <div class="elementor-testimonial__footer"> <?php if ( $slide['image']['url'] ) : ?> <div class="elementor-testimonial__image"> <img <?php $this->print_render_attribute_string( $element_key . '-image' ); ?>> <?php if ( $lazyload ) : ?> <div class="swiper-lazy-preloader"></div> <?php endif; ?> </div> <?php endif; ?> <?php $this->print_cite( $slide, 'inside' ); ?> </div> </div> <?php } protected function render() { $this->print_slider(); } public function get_group_name() { return 'carousel'; } } widgets/media-carousel.php 0000666 00000046065 15165735646 0011656 0 ustar 00 <?php namespace ElementorPro\Modules\Carousel\Widgets; use Elementor\Controls_Manager; use Elementor\Control_Media; use Elementor\Core\Kits\Documents\Tabs\Global_Typography; use Elementor\Embed; use Elementor\Group_Control_Text_Shadow; use Elementor\Group_Control_Typography; use Elementor\Icons_Manager; use Elementor\Repeater; use Elementor\Utils; use ElementorPro\Plugin; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly } class Media_Carousel extends Base { /** * @var int */ private $lightbox_slide_index; public function get_name() { return 'media-carousel'; } public function get_title() { return esc_html__( 'Media Carousel', 'elementor-pro' ); } public function get_icon() { return 'eicon-media-carousel'; } public function get_keywords() { return [ 'media', 'carousel', 'image', 'video', 'lightbox' ]; } protected function render() { $settings = $this->get_active_settings(); if ( $settings['overlay'] ) { $this->add_render_attribute( 'image-overlay', 'class', [ 'elementor-carousel-image-overlay', 'e-overlay-animation-' . $settings['overlay_animation'], ] ); } $this->print_slider(); if ( 'slideshow' !== $settings['skin'] || count( $settings['slides'] ) <= 1 ) { return; } $settings['thumbs_slider'] = true; $settings['container_class'] = 'elementor-thumbnails-swiper'; $settings['show_arrows'] = false; $this->print_slider( $settings ); } protected function register_controls() { parent::register_controls(); $this->start_controls_section( 'section_lightbox_style', [ 'label' => esc_html__( 'Lightbox', 'elementor-pro' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'lightbox_color', [ 'label' => esc_html__( 'Color', 'elementor-pro' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '#elementor-lightbox-slideshow-{{ID}}' => 'background-color: {{VALUE}};', ], ] ); $this->add_control( 'lightbox_ui_color', [ 'label' => esc_html__( 'UI Color', 'elementor-pro' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '#elementor-lightbox-slideshow-{{ID}} .dialog-lightbox-close-button, #elementor-lightbox-slideshow-{{ID}} .elementor-swiper-button' => 'color: {{VALUE}};', ], ] ); $this->add_control( 'lightbox_ui_hover_color', [ 'label' => esc_html__( 'UI Hover Color', 'elementor-pro' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '#elementor-lightbox-slideshow-{{ID}} .dialog-lightbox-close-button:hover, #elementor-lightbox-slideshow-{{ID}} .elementor-swiper-button:hover' => 'color: {{VALUE}};', ], ] ); $this->add_control( 'lightbox_video_width', [ 'label' => esc_html__( 'Video Width', 'elementor-pro' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ], 'default' => [ 'unit' => '%', ], 'range' => [ '%' => [ 'min' => 50, ], ], 'selectors' => [ '#elementor-lightbox-slideshow-{{ID}} .elementor-video-container' => 'width: {{SIZE}}{{UNIT}};', ], ] ); $this->end_controls_section(); $this->add_injections(); $this->update_controls(); } protected function add_repeater_controls( Repeater $repeater ) { $repeater->add_control( 'type', [ 'type' => Controls_Manager::CHOOSE, 'label' => esc_html__( 'Type', 'elementor-pro' ), 'default' => 'image', 'options' => [ 'image' => [ 'title' => esc_html__( 'Image', 'elementor-pro' ), 'icon' => 'eicon-image-bold', ], 'video' => [ 'title' => esc_html__( 'Video', 'elementor-pro' ), 'icon' => 'eicon-video-camera', ], ], 'toggle' => false, ] ); $repeater->add_control( 'image', [ 'label' => esc_html__( 'Image', 'elementor-pro' ), 'type' => Controls_Manager::MEDIA, 'dynamic' => [ 'active' => true, ], ] ); $repeater->add_control( 'image_link_to_type', [ 'label' => esc_html__( 'Link', 'elementor-pro' ), 'type' => Controls_Manager::SELECT, 'options' => [ '' => esc_html__( 'None', 'elementor-pro' ), 'file' => esc_html__( 'Media File', 'elementor-pro' ), 'custom' => esc_html__( 'Custom URL', 'elementor-pro' ), ], 'condition' => [ 'type' => 'image', ], ] ); $repeater->add_control( 'image_link_to', [ 'type' => Controls_Manager::URL, 'dynamic' => [ 'active' => true, ], 'placeholder' => esc_html__( 'https://your-link.com', 'elementor-pro' ), 'show_external' => 'true', 'condition' => [ 'type' => 'image', 'image_link_to_type' => 'custom', ], 'separator' => 'none', 'show_label' => false, ] ); $repeater->add_control( 'video', [ 'label' => esc_html__( 'Video Link', 'elementor-pro' ), 'type' => Controls_Manager::URL, 'dynamic' => [ 'active' => true, ], 'placeholder' => esc_html__( 'Enter your video link', 'elementor-pro' ), 'description' => esc_html__( 'YouTube or Vimeo link', 'elementor-pro' ), 'options' => false, 'condition' => [ 'type' => 'video', ], ] ); } protected function get_default_slides_count() { return 5; } protected function get_repeater_defaults() { $placeholder_image_src = Utils::get_placeholder_image_src(); return array_fill( 0, $this->get_default_slides_count(), [ 'image' => [ 'url' => $placeholder_image_src, ], ] ); } protected function get_image_caption( $slide ) { $caption_type = $this->get_settings( 'caption' ); if ( empty( $caption_type ) ) { return ''; } $attachment_post = get_post( $slide['image']['id'] ); if ( 'caption' === $caption_type ) { return $attachment_post->post_excerpt; } if ( 'title' === $caption_type ) { return $attachment_post->post_title; } return $attachment_post->post_content; } protected function get_image_link_to( $slide ) { if ( ! empty( $slide['video']['url'] ) ) { return $slide['image']['url'] ? $slide['image']['url'] : '#'; } if ( ! $slide['image_link_to_type'] ) { return ''; } if ( 'custom' === $slide['image_link_to_type'] ) { return $slide['image_link_to']['url']; } return $slide['image']['url']; } protected function print_slider( array $settings = null ) { $this->lightbox_slide_index = 0; parent::print_slider( $settings ); } protected function print_slide( array $slide, array $settings, $element_key ) { if ( ! empty( $settings['thumbs_slider'] ) ) { $settings['video_play_icon'] = false; } $this->add_render_attribute( $element_key . '-image', [ 'class' => 'elementor-carousel-image', 'role' => 'img', 'aria-label' => Control_Media::get_image_alt( $slide['image'] ), ] ); $img_src = $this->get_slide_image_url( $slide, $settings ); if ( 'yes' === $settings['lazyload'] ) { $img_attribute['class'] = 'swiper-lazy'; $img_attribute['data-background'] = $img_src; } else { $img_attribute['style'] = "background-image: url('" . $img_src . "')"; } $this->add_render_attribute( $element_key . '-image', $img_attribute ); $image_link_to = $this->get_image_link_to( $slide ); if ( $image_link_to && empty( $settings['thumbs_slider'] ) ) { if ( 'custom' === $slide['image_link_to_type'] ) { $this->add_link_attributes( $element_key . '_link', $slide['image_link_to'] ); } else { $this->add_render_attribute( $element_key . '_link', 'href', $image_link_to ); $this->add_lightbox_data_attributes( $element_key . '_link', $slide['image']['id'], 'yes', $this->get_id() ); if ( Plugin::elementor()->editor->is_edit_mode() ) { $this->add_render_attribute( $element_key . '_link', 'class', 'elementor-clickable' ); } $this->lightbox_slide_index++; } if ( 'video' === $slide['type'] && $slide['video']['url'] ) { $embed_url_params = [ 'autoplay' => 1, 'rel' => 0, 'controls' => 0, ]; $this->add_render_attribute( $element_key . '_link', 'data-elementor-lightbox-video', Embed::get_embed_url( $slide['video']['url'], $embed_url_params ) ); } // PHPCS - the method get_render_attribute_string is safe. echo '<a ' . $this->get_render_attribute_string( $element_key . '_link' ) . '>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } $this->print_slide_image( $slide, $element_key, $settings ); if ( $image_link_to ) { echo '</a>'; } } protected function print_slide_image( array $slide, $element_key, array $settings ) { ?> <div <?php $this->print_render_attribute_string( $element_key . '-image' ); ?>> <?php if ( 'yes' === $settings['lazyload'] ) : ?> <div class="swiper-lazy-preloader"></div> <?php endif; ?> <?php if ( 'video' === $slide['type'] && $settings['video_play_icon'] ) : ?> <div class="elementor-custom-embed-play"> <?php Icons_Manager::render_icon( [ 'library' => 'eicons', 'value' => 'eicon-play', ], [ 'aria-hidden' => 'true' ] ); ?> <span class="elementor-screen-only"><?php echo esc_html__( 'Play', 'elementor-pro' ); ?></span> </div> <?php endif; ?> </div> <?php if ( $settings['overlay'] ) : ?> <div <?php $this->print_render_attribute_string( 'image-overlay' ); ?>> <?php if ( 'text' === $settings['overlay'] ) { echo wp_kses_post( $this->get_image_caption( $slide ) ); } else { $this->render_overlay_icon( $settings['icon'] ); } ?> </div> <?php endif; } private function add_injections() { $this->start_injection( [ 'type' => 'section', 'at' => 'start', 'of' => 'section_slides', ] ); $this->add_control( 'skin', [ 'label' => esc_html__( 'Skin', 'elementor-pro' ), 'type' => Controls_Manager::SELECT, 'default' => 'carousel', 'options' => [ 'carousel' => esc_html__( 'Carousel', 'elementor-pro' ), 'slideshow' => esc_html__( 'Slideshow', 'elementor-pro' ), 'coverflow' => esc_html__( 'Coverflow', 'elementor-pro' ), ], 'prefix_class' => 'elementor-skin-', 'render_type' => 'template', 'frontend_available' => true, ] ); $this->end_injection(); $this->start_injection( [ 'of' => 'image_size_custom_dimension', ] ); $this->add_control( 'image_fit', [ 'label' => esc_html__( 'Image Fit', 'elementor-pro' ), 'type' => Controls_Manager::SELECT, 'default' => '', 'options' => [ '' => esc_html__( 'Cover', 'elementor-pro' ), 'contain' => esc_html__( 'Contain', 'elementor-pro' ), 'auto' => esc_html__( 'Auto', 'elementor-pro' ), ], 'selectors' => [ '{{WRAPPER}} .elementor-main-swiper .elementor-carousel-image' => 'background-size: {{VALUE}}', ], ] ); $this->end_injection(); $this->start_injection( [ 'of' => 'pagination_color', ] ); $this->add_control( 'play_icon_title', [ 'label' => esc_html__( 'Play Icon', 'elementor-pro' ), 'type' => Controls_Manager::HEADING, ] ); $this->add_control( 'play_icon_color', [ 'label' => esc_html__( 'Color', 'elementor-pro' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .elementor-custom-embed-play i' => 'color: {{VALUE}}', '{{WRAPPER}} .elementor-custom-embed-play svg' => 'fill: {{VALUE}}', ], ] ); $this->add_responsive_control( 'play_icon_size', [ 'label' => esc_html__( 'Size', 'elementor-pro' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', 'em', 'rem', 'custom' ], 'range' => [ 'px' => [ 'min' => 20, 'max' => 150, ], ], 'selectors' => [ '{{WRAPPER}} .elementor-custom-embed-play i' => 'font-size: {{SIZE}}{{UNIT}}', ], ] ); $this->add_group_control( Group_Control_Text_Shadow::get_type(), [ 'name' => 'play_icon_text_shadow', 'selector' => '{{WRAPPER}} .elementor-custom-embed-play i', 'fields_options' => [ 'text_shadow_type' => [ 'label' => _x( 'Shadow', 'Text Shadow Control', 'elementor-pro' ), ], ], ] ); $this->end_injection(); $this->start_injection( [ 'of' => 'pause_on_interaction', ] ); $this->add_control( 'overlay', [ 'label' => esc_html__( 'Overlay', 'elementor-pro' ), 'type' => Controls_Manager::SELECT, 'default' => '', 'options' => [ '' => esc_html__( 'None', 'elementor-pro' ), 'text' => esc_html__( 'Text', 'elementor-pro' ), 'icon' => esc_html__( 'Icon', 'elementor-pro' ), ], 'condition' => [ 'skin!' => 'slideshow', ], 'separator' => 'before', ] ); $this->add_control( 'caption', [ 'label' => esc_html__( 'Caption', 'elementor-pro' ), 'type' => Controls_Manager::SELECT, 'default' => 'title', 'options' => [ 'title' => esc_html__( 'Title', 'elementor-pro' ), 'caption' => esc_html__( 'Caption', 'elementor-pro' ), 'description' => esc_html__( 'Description', 'elementor-pro' ), ], 'condition' => [ 'skin!' => 'slideshow', 'overlay' => 'text', ], ] ); $this->add_control( 'icon', [ 'label' => esc_html__( 'Icon', 'elementor-pro' ), 'type' => Controls_Manager::CHOOSE, 'default' => 'search-plus', 'options' => [ 'search-plus' => [ 'icon' => 'eicon-search-bold', ], 'plus-circle' => [ 'icon' => 'eicon-plus-circle', ], 'eye' => [ 'icon' => 'eicon-preview-medium', ], 'link' => [ 'icon' => 'eicon-link', ], ], 'condition' => [ 'skin!' => 'slideshow', 'overlay' => 'icon', ], ] ); $this->add_control( 'overlay_animation', [ 'label' => esc_html__( 'Animation', 'elementor-pro' ), 'type' => Controls_Manager::SELECT, 'default' => 'fade', 'options' => [ 'fade' => 'Fade', 'slide-up' => 'Slide Up', 'slide-down' => 'Slide Down', 'slide-right' => 'Slide Right', 'slide-left' => 'Slide Left', 'zoom-in' => 'Zoom In', ], 'condition' => [ 'skin!' => 'slideshow', 'overlay!' => '', ], ] ); $this->end_injection(); $this->start_injection( [ 'type' => 'section', 'of' => 'section_navigation', ] ); $this->start_controls_section( 'section_overlay', [ 'label' => esc_html__( 'Overlay', 'elementor-pro' ), 'tab' => Controls_Manager::TAB_STYLE, 'condition' => [ 'skin!' => 'slideshow', 'overlay!' => '', ], ] ); $this->add_control( 'overlay_background_color', [ 'label' => esc_html__( 'Background Color', 'elementor-pro' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .elementor-carousel-image-overlay' => 'background-color: {{VALUE}};', ], ] ); $this->add_control( 'overlay_color', [ 'label' => esc_html__( 'Text Color', 'elementor-pro' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .elementor-carousel-image-overlay' => '--e-carousel-image-overlay-color: {{VALUE}};', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'caption_typography', 'global' => [ 'default' => Global_Typography::TYPOGRAPHY_ACCENT, ], 'selector' => '{{WRAPPER}} .elementor-carousel-image-overlay', 'condition' => [ 'overlay' => 'text', ], ] ); $this->add_control( 'icon_size', [ 'label' => esc_html__( 'Icon Size', 'elementor-pro' ), 'type' => Controls_Manager::SLIDER, 'selectors' => [ '{{WRAPPER}} .elementor-carousel-image-overlay' => '--e-carousel-image-overlay-icon-size: {{SIZE}}{{UNIT}};', ], 'condition' => [ 'overlay' => 'icon', ], ] ); $this->end_controls_section(); $this->end_injection(); // Slideshow $this->start_injection( [ 'of' => 'effect', ] ); $this->add_responsive_control( 'slideshow_height', [ 'type' => Controls_Manager::SLIDER, 'label' => esc_html__( 'Height', 'elementor-pro' ), 'size_units' => [ 'px', 'em', 'rem', 'vh', 'custom' ], 'range' => [ 'px' => [ 'min' => 20, 'max' => 1000, ], ], 'selectors' => [ '{{WRAPPER}} .elementor-main-swiper' => 'height: {{SIZE}}{{UNIT}};', ], 'condition' => [ 'skin' => 'slideshow', ], ] ); $this->add_control( 'thumbs_title', [ 'label' => esc_html__( 'Thumbnails', 'elementor-pro' ), 'type' => Controls_Manager::HEADING, 'condition' => [ 'skin' => 'slideshow', ], ] ); $this->end_injection(); $this->start_injection( [ 'of' => 'slides_per_view', ] ); $this->add_control( 'thumbs_ratio', [ 'label' => esc_html__( 'Ratio', 'elementor-pro' ), 'type' => Controls_Manager::SELECT, 'options' => [ '169' => '16:9', '219' => '21:9', '43' => '4:3', '11' => '1:1', ], 'selectors_dictionary' => [ '169' => '16 / 9', '219' => '21 / 9', '43' => '4 / 3', '11' => '1 / 1', ], 'default' => '219', 'condition' => [ 'skin' => 'slideshow', ], 'selectors' => [ '{{WRAPPER}} .elementor-thumbnails-swiper .elementor-carousel-image' => 'aspect-ratio: {{VALUE}}', ], ] ); $this->add_control( 'centered_slides', [ 'label' => esc_html__( 'Centered Slides', 'elementor-pro' ), 'type' => Controls_Manager::SWITCHER, 'condition' => [ 'skin' => 'slideshow', ], 'frontend_available' => true, ] ); $this->end_injection(); $this->start_injection( [ 'of' => 'slides_per_view', ] ); $slides_per_view = range( 1, 10 ); $slides_per_view = array_combine( $slides_per_view, $slides_per_view ); $this->add_responsive_control( 'slideshow_slides_per_view', [ 'type' => Controls_Manager::SELECT, 'label' => esc_html__( 'Slides Per View', 'elementor-pro' ), 'options' => [ '' => esc_html__( 'Default', 'elementor-pro' ) ] + $slides_per_view, 'condition' => [ 'skin' => 'slideshow', ], 'frontend_available' => true, ] ); $this->end_injection(); } private function update_controls() { $carousel_controls = [ 'slides_to_scroll', 'pagination', 'heading_pagination', 'pagination_size', 'pagination_position', 'pagination_color', ]; $carousel_responsive_controls = [ 'width', 'height', 'slides_per_view', ]; foreach ( $carousel_controls as $control_id ) { $this->update_control( $control_id, [ 'condition' => [ 'skin!' => 'slideshow', ], ], [ 'recursive' => true ] ); } foreach ( $carousel_responsive_controls as $control_id ) { $this->update_responsive_control( $control_id, [ 'condition' => [ 'skin!' => 'slideshow', ], ], [ 'recursive' => true ] ); } $this->update_responsive_control( 'space_between', [ 'selectors' => [ '{{WRAPPER}}.elementor-skin-slideshow .elementor-main-swiper' => 'margin-bottom: {{SIZE}}{{UNIT}}', ], 'render_type' => 'ui', ] ); $this->update_control( 'effect', [ 'condition' => [ 'skin!' => 'coverflow', ], ] ); } public function get_group_name() { return 'carousel'; } private function render_overlay_icon( $icon_name ) { $icon_value = 'fas fa-' . $icon_name; $icon = [ 'library' => 'fa-solid', 'value' => $icon_value, ]; Icons_Manager::render_icon( $icon ); } }
| ver. 1.4 |
Github
|
.
| PHP 5.4.45 | Generation time: 0 |
proxy
|
phpinfo
|
Settings