start_controls_section( 'testimonial_review', [ 'label' => esc_html__( 'Thinkai Testimonial Review', 'thinkai' ), ] ); //Layout Control $this->add_control( 'layout_control', [ 'label' => esc_html__( 'Layout Style', 'thinkai' ), 'label_block' => true, 'type' => Controls_Manager::SELECT, 'default' => '1', 'options' => array( '1' => esc_html__( 'Review Slide Left ', 'thinkai'), '2' => esc_html__( 'Review Slide Right ', 'thinkai'), ), ] ); //Repeater $repeater = new Repeater(); $repeater->add_control( 'transparent_title', [ 'label' => __( 'BG Transparent Title', 'thinkai' ), 'type' => Controls_Manager::TEXT, 'label_block' => true, 'dynamic' => [ 'active' => true, ], 'placeholder' => __( 'Enter your BG Title', 'thinkai' ), ] ); //Author Image $repeater->add_control( 'author_image', [ 'label' => __( 'Author Image Url', 'thinkai' ), 'type' => Controls_Manager::MEDIA, 'default' => ['url' => Utils::get_placeholder_image_src(),], ] ); //Title $repeater->add_control( 'title', [ 'label' => __( 'Title', 'thinkai' ), 'type' => Controls_Manager::TEXT, 'label_block' => true, 'dynamic' => [ 'active' => true, ], 'placeholder' => __( 'Enter your Title', 'thinkai' ), ] ); //Designation $repeater->add_control( 'designation', [ 'label' => __( 'Designation', 'thinkai' ), 'type' => Controls_Manager::TEXTAREA, 'label_block' => true, 'dynamic' => [ 'active' => true, ], 'placeholder' => __( 'Enter your Designation', 'thinkai' ), ] ); //Video Link Option $repeater->add_control( 'video_option', [ 'label' => __( 'Select Video Type', 'thinkai' ), 'label_block' => true, 'type' => Controls_Manager::SELECT, 'default' => 'src_url', 'options' => array( 'src_url' => esc_html__( 'Source URL', 'thinkai' ), 'src_media' => esc_html__( 'Source Media', 'thinkai' ), ), ] ); $repeater->add_control( 'video_link', [ 'label' => __( 'Video Source Url', 'thinkai' ), 'type' => Controls_Manager::URL, 'label_block' => true, 'placeholder' => __( 'https://your-link.com', 'thinkai' ), 'show_external' => true, 'default' => [ 'url' => '', ], 'condition' => [ 'video_option' => 'src_url' ], ] ); $repeater->add_control( 'video_source_image', [ 'label' => __( 'Video Source Media', 'thinkai' ), 'type' => Controls_Manager::MEDIA, 'media_types' => ['video'], 'condition' => [ 'video_option' => 'src_media' ], ] ); $this->add_control( 'review', [ 'label' => __('Add Review Item', 'thinkai'), 'type' => Controls_Manager::REPEATER, 'fields' => $repeater->get_controls(), 'title_field' => '{{{ title }}}', 'default' => [ [ 'transparent_title' => esc_html__( 'Review', 'thinkai' ), 'title' => esc_html__( 'Boris Elbert', 'thinkai' ), 'designation' => esc_html__( 'Manager, Ovalism Studio', 'thinkai' ), 'video_link' => esc_html__( 'https://www.youtube.com/watch?v=oV74Najm6Nc', 'thinkai' ), ], [ 'transparent_title' => esc_html__( 'Review', 'thinkai' ), 'title' => esc_html__( 'Boris Elbert', 'thinkai' ), 'designation' => esc_html__( 'Manager, Ovalism Studio', 'thinkai' ), 'video_link' => esc_html__( 'https://www.youtube.com/watch?v=oV74Najm6Nc', 'thinkai' ), ], [ 'transparent_title' => esc_html__( 'Review', 'thinkai' ), 'title' => esc_html__( 'Boris Elbert', 'thinkai' ), 'designation' => esc_html__( 'Manager, Ovalism Studio', 'thinkai' ), 'video_link' => esc_html__( 'https://www.youtube.com/watch?v=oV74Najm6Nc', 'thinkai' ), ], ], ] ); $this->end_controls_section(); } /** * Render button widget output on the frontend. * Written in PHP and used to generate the final HTML. * * @since 1.0.0 * @access protected */ protected function render() { $settings = $this->get_settings_for_display(); $allowed_tags = wp_kses_allowed_html('post'); $layout = $settings[ 'layout_control' ]; ?>