remove_section( 'author_writer_topbar' ); $wp_customize->remove_setting( 'author_writer_sticky' ); $wp_customize->remove_control( 'author_writer_sticky' ); $wp_customize->remove_setting( 'author_writer_secondary_color_option' ); $wp_customize->remove_control( 'author_writer_secondary_color_option' ); $wp_customize->remove_setting( 'author_writer_slider_content_layout' ); $wp_customize->remove_control( 'author_writer_slider_content_layout' ); $wp_customize->remove_setting( 'author_writer_slide_btn_2' ); $wp_customize->remove_control( 'author_writer_slide_btn_2' ); } add_action( 'customize_register', 'bookstore_library_remove_customize_register', 11 ); function bookstore_library_customize_register( $wp_customize ) { // Register the custom control type. $wp_customize->register_control_type( 'Bookstore_Library_Toggle_Control' ); $wp_customize->add_setting('bookstore_library_slider_content_layout',array( 'default' => 'RIGHT-ALIGN', 'priority'=> 4, 'sanitize_callback' => 'author_writer_sanitize_choices' )); $wp_customize->add_control('bookstore_library_slider_content_layout',array( 'type' => 'radio', 'label' => __('Slider Content Layout', 'bookstore-library'), 'section' => 'author_writer_slider_section', 'choices' => array( 'RIGHT-ALIGN' => __('RIGHT-ALIGN','bookstore-library'), 'CENTER-ALIGN' => __('CENTER-ALIGN','bookstore-library'), 'LEFT-ALIGN' => __('LEFT-ALIGN','bookstore-library'), ), ) ); $wp_customize->add_section( 'bookstore_library_workshop_section' , array( 'title' => __( 'Latest Event Settings', 'bookstore-library' ), 'panel' => 'author_writer_panel_id', 'priority' => 4, ) ); $wp_customize->add_setting( 'bookstore_library_workshop_show_hide', array( 'default' => true, 'transport' => 'refresh', 'sanitize_callback' => 'author_writer_sanitize_checkbox', ) ); $wp_customize->add_control( new Bookstore_Library_Toggle_Control( $wp_customize, 'bookstore_library_workshop_show_hide', array( 'label' => esc_html__( 'Show / Hide section', 'bookstore-library' ), 'section' => 'bookstore_library_workshop_section', 'type' => 'toggle', 'settings' => 'bookstore_library_workshop_show_hide', ) ) ); $wp_customize->add_setting('bookstore_library_workshop_section_short_tittle',array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('bookstore_library_workshop_section_short_tittle',array( 'label' => __('Section Short Title','bookstore-library'), 'section' => 'bookstore_library_workshop_section', 'type' => 'text' )); $wp_customize->selective_refresh->add_partial( 'bookstore_library_workshop_section_short_tittle', array( 'selector' => 'h6.title-p', 'render_callback' => 'author_writer_customize_partial_bookstore_library_workshop_section_short_tittle', )); $wp_customize->add_setting('bookstore_library_workshop_section_tittle',array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('bookstore_library_workshop_section_tittle',array( 'label' => __('Section Title','bookstore-library'), 'section' => 'bookstore_library_workshop_section', 'type' => 'text' )); $categories = get_categories(); $cats = array(); $i = 0; $offer_cat[]= 'select'; foreach($categories as $category){ if($i==0){ $default = $category->slug; $i++; } $offer_cat[$category->slug] = $category->name; } $wp_customize->add_setting('bookstore_library_workshop_section_category',array( 'default' => 'select', 'sanitize_callback' => 'author_writer_sanitize_choices', )); $wp_customize->add_control('bookstore_library_workshop_section_category',array( 'type' => 'select', 'choices' => $offer_cat, 'label' => __('Select Category','bookstore-library'), 'section' => 'bookstore_library_workshop_section', )); $wp_customize->add_setting( 'bookstore_library_remove_date', array( 'default' => true, 'transport' => 'refresh', 'sanitize_callback' => 'author_writer_sanitize_checkbox', ) ); $wp_customize->add_control( new Bookstore_Library_Toggle_Control( $wp_customize, 'bookstore_library_remove_date', array( 'label' => esc_html__( 'Show / Hide Date', 'bookstore-library' ), 'section' => 'bookstore_library_workshop_section', 'type' => 'toggle', 'settings' => 'bookstore_library_remove_date', ) ) ); $wp_customize->add_setting( 'bookstore_library_remove_time', array( 'default' => true, 'transport' => 'refresh', 'sanitize_callback' => 'author_writer_sanitize_checkbox', ) ); $wp_customize->add_control( new Bookstore_Library_Toggle_Control( $wp_customize, 'bookstore_library_remove_time', array( 'label' => esc_html__( 'Show / Hide Time', 'bookstore-library' ), 'section' => 'bookstore_library_workshop_section', 'type' => 'toggle', 'settings' => 'bookstore_library_remove_time', ) ) ); } add_action( 'customize_register', 'bookstore_library_customize_register' );