on_off_label = $args['on_off_label']; parent::__construct( $manager, $id, $args ); } public function render_content(){ ?> label ); ?> description ){ ?> description ); ?> value() == 'true' ) ? 'switch-on' : ''; $on_off_label = $this->on_off_label; ?>
link(); ?> type="hidden" value="value() ); ?>"/> taxonomy = esc_attr( $taxonomy ); parent::__construct( $manager, $id, $args ); } public function render_content() { $tax_args = array( 'hierarchical' => 0, 'taxonomy' => $this->taxonomy, ); $taxonomies = get_categories( $tax_args ); ?> remove_section( 'colors' ); // Add Slider section $wp_customize->add_section( 'better_news_vibe_slider_section', array( 'title' => esc_html__( 'Slider Section','better-news-vibe' ), 'description' => esc_html__( 'Slider Section options.', 'better-news-vibe' ), 'panel' => 'news_vibe_front_page_panel', 'priority' => 41, ) ); // Slider content enable control and setting $wp_customize->add_setting( 'better_news_vibe_slider_section_enable', array( 'default' => false, 'sanitize_callback' => 'news_vibe_sanitize_switch_control', ) ); $wp_customize->add_control( new Better_News_Vibe_Switch_Control( $wp_customize, 'better_news_vibe_slider_section_enable', array( 'label' => esc_html__( 'Slider Section Enable', 'better-news-vibe' ), 'section' => 'better_news_vibe_slider_section', 'on_off_label' => news_vibe_switch_options(), ) ) ); // Slider btn title setting and control $wp_customize->add_setting( 'better_news_vibe_slider_title', array( 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'better_news_vibe_slider_title', array( 'label' => esc_html__( 'Title', 'better-news-vibe' ), 'section' => 'better_news_vibe_slider_section', 'active_callback' => 'better_news_vibe_is_slider_section_enable', 'type' => 'text', ) ); $wp_customize->add_setting( 'better_news_vibe_slider_content_category', array( 'sanitize_callback' => 'news_vibe_sanitize_single_category', ) ) ; $wp_customize->add_control( new Better_News_Vibe_Dropdown_Taxonomies_Control( $wp_customize,'better_news_vibe_slider_content_category', array( 'label' => esc_html__( 'Select Category', 'news-vibe' ), 'description' => esc_html__( 'Note: Latest selected no of posts will be shown from selected category', 'news-vibe' ), 'section' => 'better_news_vibe_slider_section', 'type' => 'dropdown-taxonomies', 'active_callback' => 'better_news_vibe_is_slider_section_enable' ) ) ); } add_action( 'customize_register', 'better_news_vibe_customize_register' ); function better_news_vibe_is_slider_section_enable( $control ) { return ( $control->manager->get_setting( 'better_news_vibe_slider_section_enable' )->value() ); }