add_section( 'section_featured_slider', array( 'title' => __( 'Featured Slider Section', 'bizbell' ), 'priority' => 5, 'capability' => 'edit_theme_options', 'panel' => 'home_page_panel', ) ); $wp_customize->add_setting( 'theme_options[disable_featured-slider_section]', array( 'default' => $default['disable_featured-slider_section'], 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'bizbell_sanitize_switch_control', ) ); $wp_customize->add_control( new BizBell_Switch_Control( $wp_customize, 'theme_options[disable_featured-slider_section]', array( 'label' => __('Disable slider Section', 'bizbell'), 'section' => 'section_featured_slider', 'on_off_label' => bizbell_switch_options(), ) ) ); // Number of items $wp_customize->add_setting('theme_options[slider_speed]', array( 'default' => $default['slider_speed'], 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'bizbell_sanitize_number_range' ) ); $wp_customize->add_control('theme_options[slider_speed]', array( 'label' => __('Slider Speed', 'bizbell'), 'description' => __('Slider Speed Default speed 800', 'bizbell'), 'section' => 'section_featured_slider', 'settings' => 'theme_options[slider_speed]', 'type' => 'number', 'active_callback' => 'bizbell_slider_active', ) ); for( $i=1; $i<=3; $i++ ){ // Additional Information First Page $wp_customize->add_setting('theme_options[slider_page_'.$i.']', array( 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'bizbell_dropdown_pages' ) ); $wp_customize->add_control('theme_options[slider_page_'.$i.']', array( 'label' => sprintf( __('Select Page #%1$s', 'bizbell'), $i), 'section' => 'section_featured_slider', 'settings' => 'theme_options[slider_page_'.$i.']', 'type' => 'dropdown-pages', 'active_callback' => 'bizbell_slider_active', ) ); // Slider Button Text $wp_customize->add_setting('theme_options[slider_custom_btn_text_' . $i . ']', array( 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control('theme_options[slider_custom_btn_text_' . $i . ']', array( 'label' => sprintf( __('Button Label %d', 'bizbell'),$i ), 'section' => 'section_featured_slider', 'settings' => 'theme_options[slider_custom_btn_text_' . $i . ']', 'active_callback' => 'bizbell_slider_active', 'type' => 'text', ) ); // slider hr setting and control $wp_customize->add_setting( 'theme_options[slider_hr_'. $i .']', array( 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( new BizBell_Customize_Horizontal_Line( $wp_customize, 'theme_options[slider_hr_'. $i .']', array( 'section' => 'section_featured_slider', 'active_callback' => 'bizbell_slider_active', 'type' => 'hr', ) ) ); } // Slider Button Text $wp_customize->add_setting('theme_options[slider_alt_custom_btn_text]', array( 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control('theme_options[slider_alt_custom_btn_text]', array( 'label' => __('Alternative Button Label', 'bizbell'), 'section' => 'section_featured_slider', 'settings' => 'theme_options[slider_alt_custom_btn_text]', 'active_callback' => 'bizbell_slider_active', 'type' => 'text', ) ); // Slider Button Url $wp_customize->add_setting('theme_options[slider_alt_custom_btn_url]', array( 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control('theme_options[slider_alt_custom_btn_url]', array( 'label' => __('Alternative Button Url', 'bizbell'), 'section' => 'section_featured_slider', 'settings' => 'theme_options[slider_alt_custom_btn_url]', 'active_callback' => 'bizbell_slider_active', 'type' => 'url', ) );