add_section( 'buzzhub_gallery', array( 'title' => esc_html__( 'Gallery', 'buzzhub' ), 'panel' => 'buzzhub_home_panel', ) ); // gallery enable settings $wp_customize->add_setting( 'buzzhub_gallery', array( 'sanitize_callback' => 'buzzhub_sanitize_select', 'default' => 'disable' ) ); $wp_customize->add_control( 'buzzhub_gallery', array( 'section' => 'buzzhub_gallery', 'label' => esc_html__( 'Content type:', 'buzzhub' ), 'description' => esc_html__( 'Choose where you want to render the content from.', 'buzzhub' ), 'type' => 'select', 'choices' => array( 'disable' => esc_html__( '--Disable--', 'buzzhub' ), 'cat' => esc_html__( 'Category', 'buzzhub' ), ) ) ); $wp_customize->add_setting( 'buzzhub_gallery_title', array( 'sanitize_callback' => 'sanitize_text_field', 'default' => esc_html__( 'We fight for your right', 'buzzhub' ), 'transport' => 'postMessage', ) ); $wp_customize->add_control( 'buzzhub_gallery_title', array( 'section' => 'buzzhub_gallery', 'label' => esc_html__( 'Title:', 'buzzhub' ), 'active_callback' => 'buzzhub_if_gallery_enabled', ) ); $wp_customize->selective_refresh->add_partial( 'buzzhub_gallery_title', array( 'selector' => '#gallery h2.section-title', 'render_callback' => 'buzzhub_gallery_partial_title', ) ); for ($i=1; $i <= 3; $i++) { // gallery category setting $wp_customize->add_setting( 'buzzhub_gallery_cat_'.$i, array( 'sanitize_callback' => 'buzzhub_sanitize_select', ) ); $wp_customize->add_control( 'buzzhub_gallery_cat_'.$i, array( 'section' => 'buzzhub_gallery', 'label' => esc_html__( 'Category: ', 'buzzhub' ).$i, 'active_callback' => 'buzzhub_if_gallery_cat', 'type' => 'select', 'choices' => buzzhub_get_post_cat_choices(), ) ); }