start_controls_section( 'video_tabs', [ 'label' => esc_html__( 'Thinkai Video Tabs', 'thinkai' ), ] ); //BG Image $this->add_control( 'bg_image', [ 'label' => __( 'BG Image Url', 'thinkai' ), 'type' => Controls_Manager::MEDIA, 'default' => ['url' => Utils::get_placeholder_image_src(),], ] ); //Video Repeater $repeater = new Repeater(); $repeater->add_control( 'tab_btn_title', [ 'label' => __( 'Tab Button Title', 'thinkai' ), 'label_block' => true, 'type' => Controls_Manager::TEXT, 'dynamic' => [ 'active' => true, ], 'placeholder' => __( 'Enter your Tab BTN Title', 'thinkai' ), ] ); //title $repeater->add_control( 'title', [ 'label' => __( 'Title', 'thinkai' ), 'label_block' => true, 'type' => Controls_Manager::TEXTAREA, 'dynamic' => [ 'active' => true, ], 'placeholder' => __( 'Enter your Title', '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' ], ] ); //title $repeater->add_control( 'video_caption', [ 'label' => __( 'Video Caption', 'thinkai' ), 'label_block' => true, 'type' => Controls_Manager::TEXT, 'dynamic' => [ 'active' => true, ], 'placeholder' => __( 'Enter your Video Caption', 'thinkai' ), ] ); $this->add_control( 'tabs', [ 'label' => __('Add Video Tab Item', 'thinkai'), 'type' => Controls_Manager::REPEATER, 'fields' => $repeater->get_controls(), 'title_field' => '{{{ tab_btn_title }}}', 'default' => [ [ 'tab_btn_title' => esc_html__( 'Frame-by-Frame', 'thinkai' ), 'title' => esc_html__( 'We can help businesses reduce customer
service costs.', 'thinkai' ), 'src_url' => esc_html__( 'https://www.youtube.com/watch?v=oV74Najm6Nc', 'thinkai' ), 'video_caption' => esc_html__( 'Watch Demo', 'thinkai' ), ], [ 'tab_btn_title' => esc_html__( 'Backward', 'thinkai' ), 'title' => esc_html__( 'Replay, Redefine, Repeat
with ThinkAi video
Repeating.', 'thinkai' ), 'src_url' => esc_html__( 'https://www.youtube.com/watch?v=oV74Najm6Nc', 'thinkai' ), 'video_caption' => esc_html__( 'Watch Demo', 'thinkai' ), ], [ 'tab_btn_title' => esc_html__( 'Voice Over', 'thinkai' ), 'title' => esc_html__( 'Replay, Redefine, Repeat
with ThinkAi video
Repeating.', 'thinkai' ), 'src_url' => esc_html__( 'https://www.youtube.com/watch?v=oV74Najm6Nc', 'thinkai' ), 'video_caption' => esc_html__( 'Watch Demo', 'thinkai' ), ], [ 'tab_btn_title' => esc_html__( 'Screen Record', 'thinkai' ), 'title' => esc_html__( 'Replay, Redefine, Repeat
with ThinkAi video
Repeating.', 'thinkai' ), 'src_url' => esc_html__( 'https://www.youtube.com/watch?v=oV74Najm6Nc', 'thinkai' ), 'video_caption' => esc_html__( 'Watch Demo', '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'); ?>
$items){ $video_option = $items[ 'video_option' ]; if( $video_option == 'src_url' ){ $video = $items[ 'video_link' ][ 'url' ]; }elseif( $video_option == 'src_media' ){ $video = $items[ 'video_source_image' ]['url']; }else{ $video = esc_html__( 'There is no Video', 'thinkai' ); } ?>
    $items){ ?>