start_controls_section( 'faqs', [ 'label' => esc_html__( 'Thinkai Faqs', 'thinkai' ), ] ); $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__( 'Style One ', 'thinkai'), '2' => esc_html__( 'Style Two ', 'thinkai'), '3' => esc_html__( 'Style Three ', 'thinkai'), '4' => esc_html__( 'Style Four ', 'thinkai'), '5' => esc_html__( 'Style Five ', 'thinkai'), ), ] ); //BG Image $this->add_control( 'bg_img', [ 'label' => __( 'BG Image', 'thinkai' ), 'type' => Controls_Manager::MEDIA, 'default' => ['url' => Utils::get_placeholder_image_src(),], 'condition' => [ 'layout_control' => ['1','2'] ] ] ); //BG Shadow Image $this->add_control( 'bg_shadow_img', [ 'label' => __( 'BG Shadow Image', 'thinkai' ), 'type' => Controls_Manager::MEDIA, 'default' => ['url' => Utils::get_placeholder_image_src(),], 'condition' => [ 'layout_control' => '2' ] ] ); //Switcher $this->add_control( 'show_title_area', [ 'label' => esc_html__( 'Enable Title Section', 'thinkai' ), 'type' => Controls_Manager::SWITCHER, 'label_on' => esc_html__( 'On', 'thinkai' ), 'label_off' => esc_html__( 'Off', 'thinkai' ), 'return_value' => 'yes', 'default' => 'no', 'condition' => [ 'layout_control' => ['1','2'] ] ] ); //Sub Title $this->add_control( 'subtitle', [ 'label' => __( 'Sub Title', 'thinkai' ), 'label_block' => true, 'type' => Controls_Manager::TEXT, 'dynamic' => [ 'active' => true, ], 'default' => esc_html__( '[ FAQ’S ],', 'thinkai' ), 'condition' => [ 'layout_control' => ['1','2'], 'show_title_area' => 'yes' ] ] ); //Title $this->add_control( 'title', [ 'label' => __( 'Title', 'thinkai' ), 'label_block' => true, 'type' => Controls_Manager::TEXTAREA, 'dynamic' => [ 'active' => true, ], 'placeholder' => __( 'Enter your Title', 'thinkai' ), 'condition' => [ 'layout_control' => ['1','2'], 'show_title_area' => 'yes' ] ] ); //Faqs Repeater $repeater = new Repeater(); $repeater->add_control( 'faqs_title', [ 'label' => __( 'Title', 'thinkai' ), 'label_block' => true, 'type' => Controls_Manager::TEXTAREA, 'dynamic' => [ 'active' => true, ], 'placeholder' => __( 'Enter your Title', 'thinkai' ), ] ); $repeater->add_control( 'faqs_text', [ 'label' => __( 'Description', 'thinkai' ), 'label_block' => true, 'type' => Controls_Manager::TEXTAREA, 'dynamic' => [ 'active' => true, ], 'placeholder' => __( 'Enter your Description', 'thinkai' ), ] ); $this->add_control( 'faq', [ 'label' => __('Add faq Item', 'thinkai'), 'type' => Controls_Manager::REPEATER, 'fields' => $repeater->get_controls(), 'title_field' => '{{{ faqs_title }}}', 'condition' => [ 'layout_control' => ['1','2','3','4','5'] ] ] ); $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'); ?>