Sid Gifari File Manager
🏠 Root
/
home
/
ailwtbdh
/
public_html
/
wp-content
/
plugins
/
profundcore
/
addons
/
widgets
/
Editing: image-carousel.php
<?php namespace Elementor; if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly class profund_Image_Carousel extends Widget_Base { public function get_name() { return 'profund-carousel-addons'; } public function get_title() { return __( 'Image Carousel', 'profundcore' ); } public function get_icon() { return 'eicon-carousel'; } public function get_categories() { return [ 'profund-addons' ]; } public function get_script_depends() { return [ 'slick', 'el-widget-active', 'profund-main' ]; } protected function register_controls() { $this->start_controls_section( 'carosul_content', [ 'label' => __( 'Carousel', 'profundcore' ), ] ); $this->add_control( 'link_click_event', [ 'label' => __( 'Click Event', 'profundcore' ), 'type' => Controls_Manager::SELECT, 'default' => 'none', 'options' => [ 'none' => __( 'None', 'profundcore' ), 'lightbox' => __( 'Lightbox', 'profundcore' ), 'custom_link' => __( 'Custom Link', 'profundcore' ), ], 'separator' =>'before', ] ); $repeater = new Repeater(); $repeater->add_control( 'carosul_image', [ 'label' => __( 'Image', 'profundcore' ), 'type' => Controls_Manager::MEDIA, ] ); $repeater->add_group_control( Group_Control_Image_Size::get_type(), [ 'name' => 'carosul_imagesize', 'default' => 'large', 'separator' => 'none', ] ); $repeater->add_control( 'carosul_image_title', [ 'label' => __( 'Image Caption', 'profundcore' ), 'type' => Controls_Manager::TEXT, 'default' => '', ] ); $repeater->add_control( 'custom_link', [ 'label' => __( 'Custom Link', 'profundcore' ), 'type' => Controls_Manager::URL, 'placeholder' => __( 'http://your-link.com', 'profundcore' ), 'show_external' => true, 'default' => [ 'url' => '#', 'is_external' => false, 'nofollow' => true, ] ] ); $this->add_control( 'carosul_image_list', [ 'type' => Controls_Manager::REPEATER, 'fields' => $repeater->get_controls(), 'default' => [ [ 'carosul_image_title' => __('Image Grid Title','profundcore'), ], ], 'title_field' => '{{{ carosul_image_title }}}', ] ); $this->add_control( 'slider_on', [ 'label' => __( 'Slider', 'profundcore' ), 'type' => Controls_Manager::SWITCHER, 'label_on' => __( 'On', 'profundcore' ), 'label_off' => __( 'Off', 'profundcore' ), 'return_value' => 'yes', 'default' => 'yes', ] ); $this->add_control( 'show_caption', [ 'label' => __( 'Display Caption', 'profundcore' ), 'type' => Controls_Manager::SWITCHER, 'label_on' => __( 'On', 'profundcore' ), 'label_off' => __( 'Off', 'profundcore' ), 'return_value' => 'yes', 'default' => 'no', ] ); $this->add_control( 'hover_ef', [ 'label' => __( 'Hover Effect', 'profundcore' ), 'type' => Controls_Manager::SWITCHER, 'label_on' => __( 'On', 'profundcore' ), 'label_off' => __( 'Off', 'profundcore' ), 'return_value' => 'yes', 'default' => 'no', ] ); $this->end_controls_section(); // Carousel setting $this->start_controls_section( 'slider_option', [ 'label' => esc_html__( 'Carousel Option', 'profundcore' ), 'condition' => [ 'slider_on' => 'yes', ] ] ); $this->add_control( 'slitems', [ 'label' => esc_html__( 'Slider Items', 'profundcore' ), 'type' => Controls_Manager::NUMBER, 'min' => 1, 'max' => 20, 'step' => 1, 'default' => 3, 'condition' => [ 'slider_on' => 'yes', ] ] ); $this->add_control( 'slarrows', [ 'label' => esc_html__( 'Slider Arrow', 'profundcore' ), 'type' => Controls_Manager::SWITCHER, 'return_value' => 'yes', 'default' => 'yes', 'condition' => [ 'slider_on' => 'yes', ] ] ); $this->add_control( 'slprevicon', [ 'label' => __( 'Previous icon', 'profundcore' ), 'type' => Controls_Manager::ICON, 'default' => 'fa fa-angle-left', 'condition' => [ 'slider_on' => 'yes', 'slarrows' => 'yes', ] ] ); $this->add_control( 'slnexticon', [ 'label' => __( 'Next icon', 'profundcore' ), 'type' => Controls_Manager::ICON, 'default' => 'fa fa-angle-right', 'condition' => [ 'slider_on' => 'yes', 'slarrows' => 'yes', ] ] ); $this->add_control( 'sldots', [ 'label' => esc_html__( 'Slider dots', 'profundcore' ), 'type' => Controls_Manager::SWITCHER, 'return_value' => 'yes', 'default' => 'no', 'condition' => [ 'slider_on' => 'yes', ] ] ); $this->add_control( 'slpause_on_hover', [ 'type' => Controls_Manager::SWITCHER, 'label_off' => __('No', 'profundcore'), 'label_on' => __('Yes', 'profundcore'), 'return_value' => 'yes', 'default' => 'yes', 'label' => __('Pause on Hover?', 'profundcore'), 'condition' => [ 'slider_on' => 'yes', ] ] ); $this->add_control( 'slcentermode', [ 'label' => esc_html__( 'Center Mode', 'profundcore' ), 'type' => Controls_Manager::SWITCHER, 'return_value' => 'yes', 'default' => 'no', 'condition' => [ 'slider_on' => 'yes', ] ] ); $this->add_control( 'slcenterpadding', [ 'label' => esc_html__( 'Center padding', 'profundcore' ), 'type' => Controls_Manager::NUMBER, 'min' => 0, 'max' => 500, 'step' => 1, 'default' => 50, 'condition' => [ 'slider_on' => 'yes', 'slcentermode' => 'yes', ] ] ); $this->add_control( 'slautolay', [ 'label' => esc_html__( 'Slider auto play', 'profundcore' ), 'type' => Controls_Manager::SWITCHER, 'return_value' => 'yes', 'separator' => 'before', 'default' => 'no', 'condition' => [ 'slider_on' => 'yes', ] ] ); $this->add_control( 'slautoplay_speed', [ 'label' => __('Autoplay speed', 'profundcore'), 'type' => Controls_Manager::NUMBER, 'default' => 3000, 'condition' => [ 'slider_on' => 'yes', ] ] ); $this->add_control( 'slanimation_speed', [ 'label' => __('Autoplay animation speed', 'profundcore'), 'type' => Controls_Manager::NUMBER, 'default' => 300, 'condition' => [ 'slider_on' => 'yes', ] ] ); $this->add_control( 'slscroll_columns', [ 'label' => __('Slider item to scroll', 'profundcore'), 'type' => Controls_Manager::NUMBER, 'min' => 1, 'max' => 10, 'step' => 1, 'default' => 1, 'condition' => [ 'slider_on' => 'yes', ] ] ); $this->add_control( 'heading_tablet', [ 'label' => __( 'Tablet', 'profundcore' ), 'type' => Controls_Manager::HEADING, 'separator' => 'after', 'condition' => [ 'slider_on' => 'yes', ] ] ); $this->add_control( 'sltablet_display_columns', [ 'label' => __('Slider Items', 'profundcore'), 'type' => Controls_Manager::NUMBER, 'min' => 1, 'max' => 8, 'step' => 1, 'default' => 1, 'condition' => [ 'slider_on' => 'yes', ] ] ); $this->add_control( 'sltablet_scroll_columns', [ 'label' => __('Slider item to scroll', 'profundcore'), 'type' => Controls_Manager::NUMBER, 'min' => 1, 'max' => 8, 'step' => 1, 'default' => 1, 'condition' => [ 'slider_on' => 'yes', ] ] ); $this->add_control( 'sltablet_width', [ 'label' => __('Tablet Resolution', 'profundcore'), 'description' => __('The resolution to tablet.', 'profundcore'), 'type' => Controls_Manager::NUMBER, 'default' => 750, 'condition' => [ 'slider_on' => 'yes', ] ] ); $this->add_control( 'heading_mobile', [ 'label' => __( 'Mobile Phone', 'profundcore' ), 'type' => Controls_Manager::HEADING, 'separator' => 'after', 'condition' => [ 'slider_on' => 'yes', ] ] ); $this->add_control( 'slmobile_display_columns', [ 'label' => __('Slider Items', 'profundcore'), 'type' => Controls_Manager::NUMBER, 'min' => 1, 'max' => 4, 'step' => 1, 'default' => 1, 'condition' => [ 'slider_on' => 'yes', ] ] ); $this->add_control( 'slmobile_scroll_columns', [ 'label' => __('Slider item to scroll', 'profundcore'), 'type' => Controls_Manager::NUMBER, 'min' => 1, 'max' => 4, 'step' => 1, 'default' => 1, 'condition' => [ 'slider_on' => 'yes', ] ] ); $this->add_control( 'slmobile_width', [ 'label' => __('Mobile Resolution', 'profundcore'), 'description' => __('The resolution to mobile.', 'profundcore'), 'type' => Controls_Manager::NUMBER, 'default' => 480, 'condition' => [ 'slider_on' => 'yes', ] ] ); $this->end_controls_section(); // Slider Option end // Service Style tab section $this->start_controls_section( 'item_grid_style_section', [ 'label' => __( 'Column Style', 'profundcore' ), 'tab' => Controls_Manager::TAB_STYLE, 'condition' => [ 'slider_on!' => 'yes', ] ] ); $this->add_responsive_control( 'item_grid_margin', [ 'label' => __( 'Margin', 'profundcore' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em' ], 'selectors' => [ '{{WRAPPER}} .slider-column' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], 'separator' =>'before', ] ); $this->add_responsive_control( 'item_grid_padding', [ 'label' => __( 'Padding', 'profundcore' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em' ], 'selectors' => [ '{{WRAPPER}} .slider-column' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], 'separator' =>'before', ] ); $this->add_responsive_control( 'item_grid_width', [ 'label' => __( 'Width', 'profundcore' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', '%' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 1000, 'step' => 1, ], '%' => [ 'min' => 0, 'max' => 100, ] ], 'default' => [ 'unit' => '%', 'size' => 33.33, ], 'selectors' => [ '{{WRAPPER}} .slider-column' => 'width: {{SIZE}}{{UNIT}};float: left;', ], ] ); $this->end_controls_section(); // Style tab section start $this->start_controls_section( 'profund_carousel_style_section', [ 'label' => __( 'Box Style', 'profundcore' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_group_control( Group_Control_Background::get_type(), [ 'name' => 'carousel_single_background', 'label' => __( 'Background', 'profundcore' ), 'types' => [ 'classic', 'gradient' ], 'selector' => '{{WRAPPER}} .single-custom-carousel', ] ); $this->add_group_control( Group_Control_Box_Shadow::get_type(), [ 'name' => 'carousel_single_box_shadow', 'label' => __( 'Box Shadow', 'profundcore' ), 'selector' => '{{WRAPPER}} .single-custom-carousel', ] ); $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => 'carousel_single_border', 'label' => __( 'Border', 'profundcore' ), 'selector' => '{{WRAPPER}} .single-custom-carousel', ] ); $this->add_responsive_control( 'carousel_single_radius', [ 'label' => esc_html__( 'Border Radius', 'profundcore' ), 'type' => Controls_Manager::DIMENSIONS, 'selectors' => [ '{{WRAPPER}} .single-custom-carousel' => 'border-radius: {{TOP}}px {{RIGHT}}px {{BOTTOM}}px {{LEFT}}px;', ], ] ); $this->add_responsive_control( 'carousel_single_margin', [ 'label' => __( 'Margin', 'profundcore' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em' ], 'selectors' => [ '{{WRAPPER}} .single-custom-carousel' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], 'separator' =>'before', ] ); $this->add_responsive_control( 'carousel_single_padding', [ 'label' => __( 'Padding', 'profundcore' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em' ], 'selectors' => [ '{{WRAPPER}} .single-custom-carousel' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], 'separator' =>'before', ] ); $this->add_control( 'item_horizontal_align', [ 'label' => __( 'Vertical Align', 'profundcore' ), 'type' => Controls_Manager::SELECT, 'default' => 'align-items:center;', 'options' => [ 'align-items:center;' => __( 'Center', 'profundcore' ), 'align-items:flex-start;' => __( 'Start', 'profundcore' ), 'align-items:flex-end;' => __( 'End', 'profundcore' ), ], 'selectors' => [ '{{WRAPPER}} .slick-slider .slick-track' => 'display: flex; {{VALUE}}', ], 'separator' =>'before', ] ); $this->end_controls_section(); // Style tab section end // Feature Style tab section $this->start_controls_section( 'box_title_section', [ 'label' => __( 'Caption Style', 'profundcore' ), 'tab' => Controls_Manager::TAB_STYLE, 'condition' => [ 'show_caption' => 'yes' ] ] ); $this->start_controls_tabs('box_title_style_tab'); $this->start_controls_tab( 'box_title_normal', [ 'label' => __( 'Normal', 'profundcore' ), ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'feature_title_typography', 'selector' => '{{WRAPPER}} .caption', ] ); $this->add_control( 'title_color', [ 'label' => __( 'Color', 'profundcore' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .caption' => 'color: {{VALUE}};', ], ] ); $this->add_group_control( Group_Control_Background::get_type(), [ 'name' => 'title_background', 'label' => __( 'Background', 'profundcore' ), 'default' => '#ffffff', 'types' => [ 'classic', 'gradient' ], 'selector' => '{{WRAPPER}} .caption', ] ); $this->add_responsive_control( 'title_margin', [ 'label' => __( 'Margin', 'profundcore' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em' ], 'selectors' => [ '{{WRAPPER}} .caption' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], 'separator' =>'before', ] ); $this->add_responsive_control( 'title_padding', [ 'label' => __( 'Padding', 'profundcore' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em' ], 'selectors' => [ '{{WRAPPER}} .caption' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], 'separator' =>'before', ] ); $this->add_control( 'feature_title_transition', [ 'label' => __( 'Transition Duration', 'profundcore' ), 'type' => Controls_Manager::SLIDER, 'default' => [ 'size' => 0.3, ], 'range' => [ 'px' => [ 'max' => 3, 'step' => 0.1, ], ], 'selectors' => [ '{{WRAPPER}} .caption' => 'transition-duration: {{SIZE}}s', ], ] ); $this->end_controls_tab(); // Hover Style tab end $this->start_controls_tab( 'box_title_hover', [ 'label' => __( 'Hover', 'profundcore' ), ] ); $this->add_control( 'title_hover_color', [ 'label' => __( 'Color', 'profundcore' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .caption:hover' => 'color: {{VALUE}};', ], ] ); $this->add_group_control( Group_Control_Background::get_type(), [ 'name' => 'hover_title_background', 'label' => __( 'Background', 'profundcore' ), 'default' => '#ffffff', 'types' => [ 'classic', 'gradient' ], 'selector' => '{{WRAPPER}} .caption:hover', ] ); $this->end_controls_tab(); // Hover Style tab end $this->end_controls_tabs();// Box Style tabs end $this->end_controls_section(); $this->start_controls_section( 'slider_arrow_style', [ 'label' => __( 'Arrow', 'profundcore' ), 'tab' => Controls_Manager::TAB_STYLE, 'condition' =>[ 'slider_on' => 'yes', 'slarrows' => 'yes', ], ] ); $this->start_controls_tabs( 'slider_arrow_style_tabs' ); // Normal tab Start $this->start_controls_tab( 'slider_arrow_style_normal_tab', [ 'label' => __( 'Normal', 'profundcore' ), ] ); $this->add_control( 'slider_arrow_color', [ 'label' => __( 'Color', 'profundcore' ), 'type' => Controls_Manager::COLOR, 'default' => '#FFC576', 'selectors' => [ '{{WRAPPER}} .profundcore-carousel-activation .slick-arrow' => 'color: {{VALUE}};', ], ] ); $this->add_responsive_control( 'slider_arrow_fontsize', [ 'label' => __( 'Font Size', 'profundcore' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', '%' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 100, 'step' => 1, ], '%' => [ 'min' => 0, 'max' => 100, ], ], 'default' => [ 'unit' => 'px', 'size' => 16, ], 'selectors' => [ '{{WRAPPER}} .profundcore-carousel-activation .slick-arrow' => 'font-size: {{SIZE}}{{UNIT}};', ], ] ); $this->add_group_control( Group_Control_Background::get_type(), [ 'name' => 'slider_arrow_background', 'label' => __( 'Background', 'profundcore' ), 'types' => [ 'classic', 'gradient' ], 'selector' => '{{WRAPPER}} .profundcore-carousel-activation .slick-arrow', ] ); $this->add_responsive_control( 'slider_arrow_height', [ 'label' => __( 'Height', 'profundcore' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', '%' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 1000, 'step' => 1, ], '%' => [ 'min' => 0, 'max' => 100, ], ], 'default' => [ 'unit' => 'px', 'size' => 50, ], 'selectors' => [ '{{WRAPPER}} .profundcore-carousel-activation .slick-arrow' => 'height: {{SIZE}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'slider_arrow_line_height', [ 'label' => __( 'Line Height', 'profundcore' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', '%' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 1000, 'step' => 1, ], '%' => [ 'min' => 0, 'max' => 100, ], ], 'default' => [ 'unit' => 'px', 'size' => 46, ], 'selectors' => [ '{{WRAPPER}} .profundcore-carousel-activation .slick-arrow' => 'line-height: {{SIZE}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'slider_arrow_width', [ 'label' => __( 'Width', 'profundcore' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', '%' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 1000, 'step' => 1, ], '%' => [ 'min' => 0, 'max' => 100, ], ], 'default' => [ 'unit' => 'px', 'size' => 50, ], 'selectors' => [ '{{WRAPPER}} .profundcore-carousel-activation .slick-arrow' => 'width: {{SIZE}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'slider_arrow_padding', [ 'label' => __( 'Padding', 'profundcore' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em' ], 'selectors' => [ '{{WRAPPER}} .profundcore-carousel-activation .slick-arrow' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], 'separator' =>'before', ] ); $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => 'slider_arrow_border', 'label' => __( 'Border', 'profundcore' ), 'selector' => '{{WRAPPER}} .profundcore-carousel-activation .slick-arrow', ] ); $this->add_responsive_control( 'slider_arrow_border_radius', [ 'label' => esc_html__( 'Border Radius', 'profundcore' ), 'type' => Controls_Manager::DIMENSIONS, 'selectors' => [ '{{WRAPPER}} .profundcore-carousel-activation .slick-arrow' => 'border-radius: {{TOP}}px {{RIGHT}}px {{BOTTOM}}px {{LEFT}}px;', ], ] ); $this->add_group_control( Group_Control_Box_Shadow::get_type(), [ 'name' => 'slider_arrow_box_shadow', 'label' => __( 'Box Shadow', 'profundcore' ), 'selector' => '{{WRAPPER}} .profundcore-carousel-activation .slick-arrow', ] ); $this->end_controls_tab(); // Normal tab end // Hover tab Start $this->start_controls_tab( 'slider_arrow_style_hover_tab', [ 'label' => __( 'Hover', 'profundcore' ), ] ); $this->add_control( 'slider_arrow_hover_color', [ 'label' => __( 'Color', 'profundcore' ), 'type' => Controls_Manager::COLOR, 'default' => '#1F2235', 'selectors' => [ '{{WRAPPER}} .profundcore-carousel-activation .slick-arrow:hover' => 'color: {{VALUE}};', ], ] ); $this->add_group_control( Group_Control_Background::get_type(), [ 'name' => 'slider_arrow_hover_background', 'label' => __( 'Background', 'profundcore' ), 'types' => [ 'classic', 'gradient' ], 'default' => '#ffc576', 'selector' => '{{WRAPPER}} .profundcore-carousel-activation .slick-arrow:before', ] ); $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => 'slider_arrow_hover_border', 'label' => __( 'Border', 'profundcore' ), 'selector' => '{{WRAPPER}} .profundcore-carousel-activation .slick-arrow:hover', ] ); $this->add_responsive_control( 'slider_arrow_hover_border_radius', [ 'label' => esc_html__( 'Border Radius', 'profundcore' ), 'type' => Controls_Manager::DIMENSIONS, 'selectors' => [ '{{WRAPPER}} .profundcore-carousel-activation .slick-arrow:hover' => 'border-radius: {{TOP}}px {{RIGHT}}px {{BOTTOM}}px {{LEFT}}px;', ], ] ); $this->add_group_control( Group_Control_Box_Shadow::get_type(), [ 'name' => 'slider_arrow_box_shadow_hover', 'label' => __( 'Box Shadow', 'profundcore' ), 'selector' => '{{WRAPPER}} .profundcore-carousel-activation .slick-arrow:hover', ] ); $this->end_controls_tab(); // Hover tab end $this->end_controls_tabs(); $this->add_control( 'slider_arrow_position_title', [ 'label' => __( 'Arrow Position', 'profundcore' ), 'type' => Controls_Manager::HEADING, 'separator' => 'before', ] ); $this->start_controls_tabs( 'slider_arrow_position_tabs' ); // Normal tab Start $this->start_controls_tab( 'slider_arrow_prev_tab', [ 'label' => __( 'Prev', 'profundcore' ), ] ); $this->add_responsive_control( 'slider_arrow_prev_gap_x', [ 'label' => __( 'Position X', 'profundcore' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', '%', 'vw' ], 'range' => [ 'px' => [ 'min' => -9999, 'max' => 9999, 'step' => 1, ], '%' => [ 'min' => -100, 'max' => 100, 'step' => 1, ], 'vh' => [ 'min' => -100, 'max' => 100, 'step' => 1, ], ], 'default' => [ 'unit' => 'px', 'size' => 30, ], 'selectors' => [ '{{WRAPPER}} .profundcore-carousel-activation .slick-arrow.slick-prev' => 'position: absolute; left: {{SIZE}}{{UNIT}};' ], ] ); $this->add_responsive_control( 'slider_arrow_prev_gap_y', [ 'label' => __( 'Position Y', 'profundcore' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', '%', 'vh' ], 'range' => [ 'px' => [ 'min' => -9999, 'max' => 9999, 'step' => 1, ], '%' => [ 'min' => -100, 'max' => 100, 'step' => 1, ], 'vh' => [ 'min' => -100, 'max' => 100, 'step' => 1, ], ], 'default' => [ 'unit' => '%', 'size' => 45, ], 'selectors' => [ '{{WRAPPER}} .profundcore-carousel-activation .slick-arrow.slick-prev' => 'position: absolute; top: {{SIZE}}{{UNIT}};' ], ] ); $this->end_controls_tab(); // Left Arrow tab end // Hover tab Start $this->start_controls_tab( 'slider_arrow_next_tab', [ 'label' => __( 'Next', 'profundcore' ), ] ); $this->add_responsive_control( 'slider_arrow_next_gap_x', [ 'label' => __( 'Position X', 'profundcore' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', '%', 'vw' ], 'range' => [ 'px' => [ 'min' => -9999, 'max' => 9999, 'step' => 1, ], '%' => [ 'min' => -100, 'max' => 100, 'step' => 1, ], 'vh' => [ 'min' => -100, 'max' => 100, 'step' => 1, ], ], 'default' => [ 'unit' => 'px', 'size' => 30, ], 'selectors' => [ '{{WRAPPER}} .profundcore-carousel-activation .slick-arrow.slick-next' => 'position: absolute; right: {{SIZE}}{{UNIT}};' ], ] ); $this->add_responsive_control( 'slider_arrow_next_gap_y', [ 'label' => __( 'Position Y', 'profundcore' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', '%', 'vh' ], 'range' => [ 'px' => [ 'min' => -9999, 'max' => 9999, 'step' => 1, ], '%' => [ 'min' => -100, 'max' => 100, 'step' => 1, ], 'vh' => [ 'min' => -100, 'max' => 100, 'step' => 1, ], ], 'default' => [ 'unit' => '%', 'size' => 46, ], 'selectors' => [ '{{WRAPPER}} .profundcore-carousel-activation .slick-arrow.slick-next' => 'position: absolute; top: {{SIZE}}{{UNIT}};' ], ] ); $this->end_controls_tab(); // Right Arrow tab end $this->end_controls_tabs(); $this->end_controls_section(); // Style Slider arrow style end // Style Pagination button tab section $this->start_controls_section( 'product_slider_pagination_style_section', [ 'label' => __( 'Pagination', 'profundcore' ), 'tab' => Controls_Manager::TAB_STYLE, 'condition'=>[ 'slider_on' => 'yes', 'sldots'=>'yes' ] ] ); $this->start_controls_tabs('pagination_style_tabs'); $this->start_controls_tab( 'pagination_style_normal_tab', [ 'label' => __( 'Normal', 'profundcore' ), ] ); $this->add_responsive_control( 'slider_pagination_height', [ 'label' => __( 'Height', 'profundcore' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', '%' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 1000, 'step' => 1, ], '%' => [ 'min' => 0, 'max' => 100, ], ], 'default' => [ 'unit' => 'px', 'size' => 15, ], 'selectors' => [ '{{WRAPPER}} .profundcore-carousel-activation .slick-dots li button' => 'height: {{SIZE}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'slider_pagination_width', [ 'label' => __( 'Width', 'profundcore' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', '%' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 1000, 'step' => 1, ], '%' => [ 'min' => 0, 'max' => 100, ], ], 'default' => [ 'unit' => 'px', 'size' => 15, ], 'selectors' => [ '{{WRAPPER}} .profundcore-carousel-activation .slick-dots li button' => 'width: {{SIZE}}{{UNIT}};', ], ] ); $this->add_group_control( Group_Control_Background::get_type(), [ 'name' => 'pagination_background', 'label' => __( 'Background', 'profundcore' ), 'types' => [ 'classic', 'gradient' ], 'selector' => '{{WRAPPER}} .profundcore-carousel-activation .slick-dots li button', ] ); $this->add_responsive_control( 'pagination_margin', [ 'label' => __( 'Margin', 'profundcore' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em' ], 'selectors' => [ '{{WRAPPER}} .profundcore-carousel-activation .slick-dots li button' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => 'pagination_border', 'label' => __( 'Border', 'profundcore' ), 'selector' => '{{WRAPPER}} .profundcore-carousel-activation .slick-dots li button', ] ); $this->add_responsive_control( 'pagination_border_radius', [ 'label' => esc_html__( 'Border Radius', 'profundcore' ), 'type' => Controls_Manager::DIMENSIONS, 'selectors' => [ '{{WRAPPER}} .profundcore-carousel-activation .slick-dots li button' => 'border-radius: {{TOP}}px {{RIGHT}}px {{BOTTOM}}px {{LEFT}}px;', ], ] ); $this->end_controls_tab(); // Normal Tab end $this->start_controls_tab( 'pagination_style_active_tab', [ 'label' => __( 'Active', 'profundcore' ), ] ); $this->add_responsive_control( 'slider_pagination_active_height', [ 'label' => __( 'Height', 'profundcore' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', '%' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 1000, 'step' => 1, ], '%' => [ 'min' => 0, 'max' => 100, ], ], 'default' => [ 'unit' => 'px', 'size' => 15, ], 'selectors' => [ '{{WRAPPER}} .profundcore-carousel-activation .slick-dots li.slick-active button' => 'height: {{SIZE}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'slider_pagination_active_width', [ 'label' => __( 'Width', 'profundcore' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', '%' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 1000, 'step' => 1, ], '%' => [ 'min' => 0, 'max' => 100, ], ], 'default' => [ 'unit' => 'px', 'size' => 15, ], 'selectors' => [ '{{WRAPPER}} .profundcore-carousel-activation .slick-dots li.slick-active button' => 'width: {{SIZE}}{{UNIT}};', ], ] ); $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => 'pagination_hover_border', 'label' => __( 'Border', 'profundcore' ), 'selector' => '{{WRAPPER}} .profundcore-carousel-activation .slick-dots li:hover, {{WRAPPER}} .profundcore-carousel-activation .slick-dots li.slick-active button', ] ); $this->add_responsive_control( 'pagination_hover_border_radius', [ 'label' => esc_html__( 'Border Radius', 'profundcore' ), 'type' => Controls_Manager::DIMENSIONS, 'selectors' => [ '{{WRAPPER}} .profundcore-carousel-activation .slick-dots li.slick-active' => 'border-radius: {{TOP}}px {{RIGHT}}px {{BOTTOM}}px {{LEFT}}px;', '{{WRAPPER}} .profundcore-carousel-activation .slick-dots li:hover button' => 'border-radius: {{TOP}}px {{RIGHT}}px {{BOTTOM}}px {{LEFT}}px;', ], ] ); $this->end_controls_tab(); // Hover Tab end $this->end_controls_tabs(); $this->end_controls_section(); } protected function render( $instance = [] ) { $settings = $this->get_settings_for_display(); // Carousel Attribute $this->add_render_attribute( 'profundcore_carosul_attr', 'class', 'profund-custom-carousel' ); if( $settings['hover_ef'] == 'yes' ){ $this->add_render_attribute( 'profundcore_carosul_attr', 'class', 'hover-ef' ); } if( $settings['slider_on'] == 'yes' ){ $this->add_render_attribute( 'profundcore_carosul_attr', 'class', 'profundcore-carousel-activation' ); $slider_settings = [ 'arrows' => ('yes' === $settings['slarrows']), 'arrow_prev_txt' => $settings['slprevicon'], 'arrow_next_txt' => $settings['slnexticon'], 'dots' => ('yes' === $settings['sldots']), 'autoplay' => ('yes' === $settings['slautolay']), 'autoplay_speed' => absint($settings['slautoplay_speed']), 'animation_speed' => absint($settings['slanimation_speed']), 'pause_on_hover' => ('yes' === $settings['slpause_on_hover']), 'center_mode' => ( 'yes' === $settings['slcentermode']), 'center_padding' => absint($settings['slcenterpadding']), ]; $slider_responsive_settings = [ 'display_columns' => $settings['slitems'], 'scroll_columns' => $settings['slscroll_columns'], 'tablet_width' => $settings['sltablet_width'], 'tablet_display_columns' => $settings['sltablet_display_columns'], 'tablet_scroll_columns' => $settings['sltablet_scroll_columns'], 'mobile_width' => $settings['slmobile_width'], 'mobile_display_columns' => $settings['slmobile_display_columns'], 'mobile_scroll_columns' => $settings['slmobile_scroll_columns'], ]; $slider_settings = array_merge( $slider_settings, $slider_responsive_settings ); $this->add_render_attribute( 'profundcore_carosul_attr', 'data-settings', wp_json_encode( $slider_settings ) ); }else{ $this->add_render_attribute( 'profundcore_carosul_attr', 'class', ['profundcore-carousel-grid','clearfix masonrys'] ); } ?><div <?php echo $this->get_render_attribute_string('profundcore_carosul_attr'); ?> > <?php foreach ( $settings['carosul_image_list'] as $imagecarosul ): ?> <div class="slider-column" > <div class="single-custom-carousel" > <?php if( $settings['link_click_event'] == 'lightbox' ){ echo '<a href="'.$imagecarosul['carosul_image']['url'].'" class="lightbox" >'.Group_Control_Image_Size::get_attachment_image_html( $imagecarosul, 'carosul_imagesize', 'carosul_image' ).'</a>'; }elseif( $settings['link_click_event'] == 'custom_link' ){ if ( ! empty( $imagecarosul['custom_link']['url'] ) ) { $link_attr = 'href="'.esc_url($imagecarosul['custom_link']['url']).'"'; if ( $imagecarosul['custom_link']['is_external'] ) { $link_attr .= ' target="_blank"'; } if ( ! empty( $imagecarosul['custom_link']['nofollow'] ) ) { $link_attr .= ' rel="nofollow"'; } echo '<a '.$link_attr.' >'.Group_Control_Image_Size::get_attachment_image_html( $imagecarosul, 'carosul_imagesize', 'carosul_image' ).'</a>'; }else{ echo Group_Control_Image_Size::get_attachment_image_html( $imagecarosul, 'carosul_imagesize', 'carosul_image' ); } unset($link_attr); }else{ echo Group_Control_Image_Size::get_attachment_image_html( $imagecarosul, 'carosul_imagesize', 'carosul_image' ); } ?> <?php if( $settings['show_caption'] == 'yes' and !empty($imagecarosul['carosul_image_title']) ): ?> <h3 class="caption"><?php echo esc_html($imagecarosul['carosul_image_title']); ?></h3> <?php endif; ?> </div> </div> <?php endforeach;?> </div><?php } } Plugin::instance()->widgets_manager->register_widget_type( new profund_Image_Carousel );
Save
Cancel