[ 'label' => __( 'Height', text_domain ), 'type' => Controls_Manager::SLIDER, 'range' => [ 'px' => [ 'min' => 0, 'max' => 100, ], ], 'default' => [ 'unit' => 'px', 'size' => 10, ], 'size_units' => [ 'px'], 'selectors' => [ '{{WRAPPER}} .slick-dots li' => 'height: {{SIZE}}{{UNIT}};', ], 'condition' => [ 'navigation' => ['both', 'dots'], ], ] ); $this->add_control( 'dots_color', [ 'label' => __( 'Dots Color', text_domain ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .slick-dots li' => 'background-color: {{VALUE}};', ], 'default' => '#FFFFFF', 'condition' => [ 'navigation' => [ 'dots', 'both' ], ], ] ); $this->add_control( 'active_dot_color', [ 'label' => __( 'Active Dot Color', text_domain ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .slick-dots .slick-active' => 'background-color: {{VALUE}};', ], 'default' => '#000000C4', 'condition' => [ 'navigation' => [ 'dots', 'both' ], ], ] ); $this->add_responsive_control( 'active_dots_slider_width', [ 'label' => __( 'Width', text_domain ), 'type' => Controls_Manager::SLIDER, 'range' => [ 'px' => [ 'min' => 0, 'max' => 100, ], ], 'default' => [ 'unit' => 'px', 'size' => 15, ], 'size_units' => [ 'px'], 'selectors' => [ '{{WRAPPER}} .slick-dots .slick-active' => 'width: {{SIZE}}{{UNIT}};', ], 'condition' => [ 'navigation' => ['both', 'dots'], ], ] ); $this->add_responsive_control( 'active_dots_slider_height', [ 'label' => __( 'Height', text_domain ), 'type' => Controls_Manager::SLIDER, 'range' => [ 'px' => [ 'min' => 0, 'max' => 100, ], ], 'default' => [ 'unit' => 'px', 'size' => 15, ], 'size_units' => [ 'px'], 'selectors' => [ '{{WRAPPER}} .slick-dots .slick-active' => 'height: {{SIZE}}{{UNIT}};', ], 'condition' => [ 'navigation' => ['both', 'dots'], ], ] ); $this->add_responsive_control( 'dots_margin', [ 'label' => esc_html__('Margin', text_domain), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => ['px', 'em', '%'], 'selectors' => [ '{{WRAPPER}} .slick-dots li' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], 'default' => [ 'top' => '0', 'right' => '3', 'bottom' => '0', 'left' => '3', 'unit' => 'px', ], 'condition' => [ 'navigation' => ['both', 'dots'], ], ] ); $this->add_responsive_control( 'dots_radius', [ 'label' => __('Border Radius', text_domain), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => ['px', '%'], 'default' => [ 'top' => '50', 'right' => '50', 'bottom' => '50', 'left' => '50', 'unit' => 'px', ], 'selectors' => [ '{{WRAPPER}} ul.slick-dots li button,{{WRAPPER}} ul.slick-dots li' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}; box-sizing:content-box;', ], 'condition' => [ 'navigation' => ['both', 'dots'], ], ] ); $this->end_controls_section(); } protected function render( ) { $settings = $this->get_settings(); $post_type = $settings['post_type']; $is_rtl = is_rtl(); $direction = $is_rtl ? 'rtl' : 'ltr'; $light_link_icon = $settings['light_link_icon']; $light_box_icon = $settings['light_box_icon']; $editor = Plugin::$instance->editor->is_edit_mode(); $show_dots = ( in_array( $settings['navigation'], [ 'dots', 'both' ] ) ); $show_arrows = ( in_array( $settings['navigation'], [ 'arrows', 'both' ] ) ); $data_slick = [ 'slidesToShow' => $settings['post_carousel_columns'], 'slidesToScroll' => 1, 'autoplay' => ( 'yes' === $settings['autoplay'] ), 'infinite' => ( 'yes' === $settings['infinite'] ), 'speed' => absint( $settings['autoplay_speed'] ), 'pauseOnHover' => ( 'yes' === $settings['pause_on_hover'] ), 'autoplaySpeed' => 2000, 'arrows' => $show_arrows, 'dots' => $show_dots, 'rtl' => $is_rtl, 'centerMode' => ( 'yes' === $settings['centerMode'] ), ]; $this->add_render_attribute( 'slides', [ 'data-slick' => wp_json_encode( $data_slick ), ] ); $image_size = $settings['image_size']; $id = $this->get_id(); if('custom' == $image_size) { $width = $settings['image_custom_dimension']['width']; $height = $settings['image_custom_dimension']['height']; add_image_size( "custom-$id", $width, $height, true ); } echo '
'; } } Plugin::instance()->widgets_manager->register_widget_type( new Themento_Post_Carousel );
دیدگاهها
هیچ دیدگاهی برای این محصول نوشته نشده است.