add_section( 'blogable_featured_post_section', array( 'title' => esc_html__( 'Featured Post','blogable' ), 'description' => esc_html__( 'Featured Post Section options.', 'blogable' ), 'panel' => 'blogable_front_page_panel', ) ); // Service content enable control and setting $wp_customize->add_setting( 'blogable_theme_options[featured_post_section_enable]', array( 'default' => $options['featured_post_section_enable'], 'sanitize_callback' => 'blogable_sanitize_switch_control', ) ); $wp_customize->add_control( new Blogable_Switch_Control( $wp_customize, 'blogable_theme_options[featured_post_section_enable]', array( 'label' => esc_html__( 'Featured Post Section Enable', 'blogable' ), 'section' => 'blogable_featured_post_section', 'on_off_label' => blogable_switch_options(), ) ) ); for ( $i = 1; $i <= $options['featured_post_count']; $i++ ) : // featured_post pages drop down chooser control and setting $wp_customize->add_setting( 'blogable_theme_options[featured_post_content_page_' . $i . ']', array( 'sanitize_callback' => 'blogable_sanitize_page', ) ); $wp_customize->add_control( new Blogable_Dropdown_Chooser( $wp_customize, 'blogable_theme_options[featured_post_content_page_' . $i . ']', array( 'label' => sprintf( esc_html__( 'Select Page %d', 'blogable' ), $i ), 'section' => 'blogable_featured_post_section', 'choices' => blogable_page_choices(), 'active_callback' => 'blogable_is_featured_post_section_enable', ) ) ); // featured_post hr setting and control $wp_customize->add_setting( 'blogable_theme_options[featured_post_hr_'. $i .']', array( 'sanitize_callback' => 'blogable_sanitize_html' ) ); $wp_customize->add_control( new Blogable_Customize_Horizontal_Line( $wp_customize, 'blogable_theme_options[featured_post_hr_'. $i .']', array( 'section' => 'blogable_featured_post_section', 'active_callback' => 'blogable_is_featured_post_section_enable', 'type' => 'hr' ) ) ); endfor;