get_prefixed_hook( 'controllers/starts' ), [ & $this ] ); $this->start_controls_section( 'advance_tab_section_content', [ 'label' => __( 'Template Style', 'absolute-addons' ), ] ); $advance_tab = apply_filters( $this->get_prefixed_hook( 'styles' ), [ 'one' => __( 'Style One', 'absolute-addons' ), 'two-pro' => __( 'Style Two (Pro)', 'absolute-addons' ), 'three-pro' => __( 'Style Three(Pro)', 'absolute-addons' ), 'four-pro' => __( 'Style Four (Pro)', 'absolute-addons' ), 'five-pro' => __( 'Style Five (Pro)', 'absolute-addons' ), 'six-pro' => __( 'Style Six (Pro)', 'absolute-addons' ), 'seven-pro' => __( 'Style Seven (Pro)', 'absolute-addons' ), 'eight' => __( 'Style Eight', 'absolute-addons' ), 'nine' => __( 'Style Nine', 'absolute-addons' ), 'ten-pro' => __( 'Style Ten (Pro)', 'absolute-addons' ), ] ); $pro_styles = [ 'two-pro', 'three-pro', 'four-pro', 'five-pro', 'six-pro', 'seven-pro', 'ten-pro', ]; $this->add_control( 'advance_tab', [ 'label' => __( 'Advance Tab Style', 'absolute-addons' ), 'label_block' => true, 'type' => Absp_Control_Styles::TYPE, 'options' => $advance_tab, 'default' => 'one', ] ); $this->init_pro_alert( $pro_styles ); $this->add_control( 'view', [ 'label' => __( 'View', 'absolute-addons' ), 'type' => Controls_Manager::HIDDEN, 'default' => 'traditional', ] ); $this->add_control( 'absp_tab_position', [ 'label' => __( 'Position', 'absolute-addons' ), 'type' => Controls_Manager::SELECT, 'default' => 'horizontal', 'options' => [ 'horizontal' => __( 'Horizontal', 'absolute-addons' ), 'vertical' => __( 'Vertical', 'absolute-addons' ), ], 'prefix_class' => 'absp-tabs-view-', 'separator' => 'before', ] ); $this->add_control( 'tabs_align_horizontal', [ 'label' => __( 'Alignment', 'absolute-addons' ), 'type' => Controls_Manager::CHOOSE, 'options' => [ '' => [ 'title' => __( 'Start', 'absolute-addons' ), 'icon' => 'eicon-h-align-left', ], 'center' => [ 'title' => __( 'Center', 'absolute-addons' ), 'icon' => 'eicon-h-align-center', ], 'end' => [ 'title' => __( 'End', 'absolute-addons' ), 'icon' => 'eicon-h-align-right', ], 'stretch' => [ 'title' => __( 'Justified', 'absolute-addons' ), 'icon' => 'eicon-h-align-stretch', ], ], 'prefix_class' => 'absp-tabs-alignment-', 'condition' => [ 'absp_tab_position' => 'horizontal', ], ] ); $this->add_control( 'tabs_align_vertical', [ 'label' => __( 'Alignment', 'absolute-addons' ), 'type' => Controls_Manager::CHOOSE, 'options' => [ '' => [ 'title' => __( 'Start', 'absolute-addons' ), 'icon' => 'eicon-v-align-top', ], 'center' => [ 'title' => __( 'Center', 'absolute-addons' ), 'icon' => 'eicon-v-align-middle', ], 'end' => [ 'title' => __( 'End', 'absolute-addons' ), 'icon' => 'eicon-v-align-bottom', ], 'stretch' => [ 'title' => __( 'Justified', 'absolute-addons' ), 'icon' => 'eicon-v-align-stretch', ], ], 'prefix_class' => 'absp-tabs-alignment-', 'condition' => [ 'absp_tab_position' => 'vertical', ], ] ); $this->add_control( 'title_html_tag', [ 'label' => __( 'Content Title HTML Tag', 'absolute-addons' ), 'type' => Controls_Manager::SELECT, 'options' => [ 'h1' => 'H1', 'h2' => 'H2', 'h3' => 'H3', 'h4' => 'H4', 'h5' => 'H5', 'h6' => 'H6', 'div' => 'div', ], 'default' => 'h3', 'separator' => 'before', ] ); $this->end_controls_section(); $this->content_section( 'one' ); $this->content_section( 'two' ); $this->content_section( 'three' ); $this->content_section( 'four' ); $this->content_section( 'five' ); $this->content_section( 'six' ); $this->content_section( 'seven' ); $this->content_section( 'eight' ); $this->content_section( 'nine' ); $this->content_section( 'ten' ); $this->render_controller( 'template-advance-tab-style' ); /** * Fires after controllers are registered. * * @param Absoluteaddons_Style_Advance_Tab $this Current instance of WP_Network_Query (passed by reference). * * @since 1.0.0 * */ do_action_ref_array( $this->get_prefixed_hook( 'controllers/ends' ), [ & $this ] ); } /** * Render content section controllers. * * @param string $style * * @todo merge from other repeater, load from pro. * */ private function content_section( $style = '' ) { $this->start_controls_section( 'advance_tab_section_' . $style, [ 'label' => __( 'Content Section', 'absolute-addons' ), 'condition' => [ 'advance_tab' => $style, ], ] ); $repeater = new Repeater(); $repeater->add_control( 'absp_tab_title', [ 'label' => __( 'Tab Title', 'absolute-addons' ), 'type' => Controls_Manager::TEXT, 'default' => __( 'Tab Title', 'absolute-addons' ), 'placeholder' => __( 'Tab Title', 'absolute-addons' ), 'label_block' => true, 'dynamic' => [ 'active' => true ], ] ); if ( in_array( $style, [ 'five', 'six', 'seven', 'eight', 'ten' ] ) ) { $repeater->add_control( 'tab_icon_select', [ 'label' => __( 'Show Tab Icon', 'absolute-addons' ), 'type' => Controls_Manager::SELECT, 'options' => [ 'true' => __( 'Yes', 'absolute-addons' ), 'false' => __( 'No', 'absolute-addons' ), ], 'default' => 'true', 'separator' => 'before', ] ); $repeater->add_control( 'tab_icon', [ 'label' => __( 'Tab Icon', 'absolute-addons' ), 'type' => Controls_Manager::ICONS, 'fa4compatibility' => 'absolute-addons', 'default' => [ 'value' => 'fas fa-camera', 'library' => 'solid', ], 'condition' => [ 'tab_icon_select' => 'true', ], ] ); } if ( in_array( $style, [ 'one', 'two', 'five', 'eight' ] ) ) { $repeater->add_group_control( Group_Control_Image_Size::get_type(), [ 'name' => 'thumbnail', 'exclude' => [ 'custom' ], // phpcs:ignore WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_exclude 'separator' => 'none', ] ); } if ( in_array( $style, [ 'one', 'five' ] ) ) { $repeater->add_control( 'advance_tab_gallery', [ 'label' => __( 'Add Gallery', 'absolute-addons' ), 'type' => Controls_Manager::GALLERY, 'show_label' => false, 'dynamic' => [ 'active' => true, ], ] ); $repeater->add_control( 'caption_source', [ 'label' => __( 'Caption', 'absolute-addons' ), 'type' => Controls_Manager::SELECT, 'options' => [ 'none' => __( 'None', 'absolute-addons' ), 'attachment' => __( 'Attachment Caption', 'absolute-addons' ), 'custom' => __( 'Custom Caption', 'absolute-addons' ), ], 'default' => 'none', ] ); $repeater->add_control( 'caption', [ 'label' => __( 'Custom Caption', 'absolute-addons' ), 'type' => Controls_Manager::TEXT, 'default' => '', 'placeholder' => __( 'Enter your image caption', 'absolute-addons' ), 'condition' => [ 'caption_source' => 'custom', ], 'dynamic' => [ 'active' => true, ], ] ); $gallery_columns = range( 1, 4 ); $repeater->add_control( 'gallery_columns', [ 'label' => __( 'Columns', 'absolute-addons' ), 'type' => Controls_Manager::SELECT, 'options' => array_combine( $gallery_columns, $gallery_columns ), 'default' => 2, ] ); } if ( in_array( $style, [ 'two', 'four', 'five', 'six', 'eight', 'nine' ] ) ) { $repeater->add_control( 'tab_image', [ 'label' => __( 'Add Image', 'absolute-addons' ), 'type' => Controls_Manager::MEDIA, 'default' => [ 'url' => Utils::get_placeholder_image_src(), ], ] ); } if ( in_array( $style, [ 'two', 'three', 'five', 'six', 'seven', 'ten' ] ) ) { $repeater->add_control( 'absp_content_sub_title', [ 'label' => __( 'Content Sub Title', 'absolute-addons' ), 'type' => Controls_Manager::TEXT, 'default' => __( 'Content Sub Title', 'absolute-addons' ), 'placeholder' => __( 'Content Sub Title', 'absolute-addons' ), 'label_block' => true, 'dynamic' => [ 'active' => true, ], ] ); } $repeater->add_control( 'absp_content_title', [ 'label' => __( 'Content Title', 'absolute-addons' ), 'type' => Controls_Manager::TEXT, 'default' => __( 'Content Title', 'absolute-addons' ), 'placeholder' => __( 'Content Title', 'absolute-addons' ), 'label_block' => true, 'dynamic' => [ 'active' => true, ], ] ); $repeater->add_control( 'absp_tab_content', [ 'label' => __( 'Content', 'absolute-addons' ), 'default' => __( 'Tab Content', 'absolute-addons' ), 'placeholder' => __( 'Tab Content', 'absolute-addons' ), 'type' => Controls_Manager::WYSIWYG, ] ); if ( in_array( $style, [ 'one', 'four', 'seven', 'eight', 'nine' ] ) ) { $this->render_read_more_control( $repeater ); } $this->add_control( 'absp_tabs_' . $style, [ 'label' => __( 'Tabs Items', 'absolute-addons' ), 'type' => Controls_Manager::REPEATER, 'fields' => $repeater->get_controls(), 'default' => [ [ 'absp_tab_title' => __( 'Tab #1', 'absolute-addons' ), 'absp_content_title' => __( 'Tab #1 Content Title', 'absolute-addons' ), 'absp_tab_content' => __( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.', 'absolute-addons' ), ], [ 'absp_tab_title' => __( 'Tab #2', 'absolute-addons' ), 'absp_content_title' => __( 'Tab #2 Content Title', 'absolute-addons' ), 'absp_tab_content' => __( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.', 'absolute-addons' ), ], [ 'absp_tab_title' => __( 'Tab #3', 'absolute-addons' ), 'absp_content_title' => __( 'Tab #3 Content Title', 'absolute-addons' ), 'absp_tab_content' => __( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.', 'absolute-addons' ), ], [ 'absp_tab_title' => __( 'Tab #4', 'absolute-addons' ), 'absp_content_title' => __( 'Tab #4 Content Title', 'absolute-addons' ), 'absp_tab_content' => __( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.', 'absolute-addons' ), ], ], 'title_field' => '{{{ absp_tab_title }}}', 'condition' => [ 'advance_tab' => $style, ], ] ); $this->end_controls_section(); } protected function render() { $settings = $this->get_settings_for_display(); $style = $settings['advance_tab']; $this->current_style = $style; $id_int = substr( $this->get_id_int(), 0, 3 ); $this->add_render_attribute( 'tab-content-title', 'class', 'content-title' ) ?>
current_style, [ 'five', 'six', 'seven', 'eight', 'ten' ] ) ) { ?>