add_section( 'buzzhub_cta', array( 'title' => esc_html__( 'Cta', 'buzzhub' ), 'panel' => 'buzzhub_home_panel', ) ); // blog enable settings $wp_customize->add_setting( 'buzzhub_cta', array( 'sanitize_callback' => 'buzzhub_sanitize_select', 'default' => 'disable', ) ); $wp_customize->add_control( 'buzzhub_cta', array( 'section' => 'buzzhub_cta', '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' ), 'page' => esc_html__( 'Page', 'buzzhub' ), ) ) ); $wp_customize->add_setting( 'buzzhub_cta_bg_image', array( 'sanitize_callback' => 'buzzhub_sanitize_image', ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'buzzhub_cta_bg_image', array( 'label' => esc_html__( 'cta Image', 'buzzhub' ), 'section' => 'buzzhub_cta', 'active_callback' => 'buzzhub_if_cta_enabled', ) ) ); for ($i=1; $i <= 1 ; $i++) { // blog page setting $wp_customize->add_setting( 'buzzhub_cta_page_'.$i, array( 'sanitize_callback' => 'buzzhub_sanitize_dropdown_pages', 'default' => 0, ) ); $wp_customize->add_control( 'buzzhub_cta_page_'.$i, array( 'section' => 'buzzhub_cta', 'label' => esc_html__( 'Page ', 'buzzhub' ).$i, 'type' => 'dropdown-pages', 'active_callback' => 'buzzhub_if_cta_page' ) ); }