add_section( 'business_center_pro_slider_section', array( 'title' => esc_html__( 'Slider Options','business-center-pro' ), 'description' => esc_html__( 'Slider options.', 'business-center-pro' ), 'panel' => 'business_center_pro_sections_panel', ) ); /** * Slider Options */ // Enable slider. $wp_customize->add_setting( 'business_center_pro_theme_options[enable_slider]', array( 'default' => $options['enable_slider'], 'sanitize_callback' => 'business_center_pro_sanitize_checkbox', ) ); $wp_customize->add_control( 'business_center_pro_theme_options[enable_slider]', array( 'label' => esc_html__( 'Enable Slider?', 'business-center-pro' ), 'section' => 'business_center_pro_slider_section', 'type' => 'checkbox' ) ); // Overlay type. $wp_customize->add_setting( 'business_center_pro_theme_options[slider_overlay]', array( 'default' => $options['slider_overlay'], 'sanitize_callback' => 'business_center_pro_sanitize_select', ) ); $wp_customize->add_control( 'business_center_pro_theme_options[slider_overlay]', array( 'active_callback' => 'business_center_pro_is_slider_enable', 'label' => esc_html__( 'Overlay Type?', 'business-center-pro' ), 'section' => 'business_center_pro_slider_section', 'choices' => business_center_pro_overlay_type_options(), 'type' => 'select' ) ); // Opacity value. $wp_customize->add_setting( 'business_center_pro_theme_options[opacity_value]', array( 'default' => $options['opacity_value'], 'sanitize_callback' => 'business_center_pro_sanitize_number_range', ) ); $wp_customize->add_control( 'business_center_pro_theme_options[opacity_value]', array( 'active_callback' => 'business_center_pro_is_opacity_type_custom', 'label' => esc_html__( 'Opacity Value?', 'business-center-pro' ), 'description' => esc_html__( 'Note: The value ranges form 0 to 1.', 'business-center-pro' ), 'section' => 'business_center_pro_slider_section', 'type' => 'number', 'input_attrs' => array( 'max' => 1, 'min' => 0, 'step' => 0.1 ) ) ); // Transition type. $wp_customize->add_setting( 'business_center_pro_theme_options[slider_transition]', array( 'default' => $options['slider_transition'], 'sanitize_callback' => 'business_center_pro_sanitize_select', ) ); $wp_customize->add_control( 'business_center_pro_theme_options[slider_transition]', array( 'active_callback' => 'business_center_pro_is_slider_enable', 'label' => esc_html__( 'Transition Effects', 'business-center-pro' ), 'section' => 'business_center_pro_slider_section', 'choices' => business_center_pro_transition_effects_options(), 'type' => 'select' ) ); // Slider speed. $wp_customize->add_setting( 'business_center_pro_theme_options[slider_speed]', array( 'default' => $options['slider_speed'], 'sanitize_callback' => 'business_center_pro_sanitize_number_range', ) ); $wp_customize->add_control( 'business_center_pro_theme_options[slider_speed]', array( 'active_callback' => 'business_center_pro_is_slider_enable', 'label' => esc_html__( 'Slider Speed ( in milliseconds )', 'business-center-pro' ), 'section' => 'business_center_pro_slider_section', 'input_attrs' => array( 'min' => 1 ), 'type' => 'number' ) ); // Add enable slider pager setting and control. $wp_customize->add_setting( 'business_center_pro_theme_options[enable_slider_pager]', array( 'default' => $options['enable_slider_pager'], 'sanitize_callback' => 'business_center_pro_sanitize_checkbox' ) ); $wp_customize->add_control( 'business_center_pro_theme_options[enable_slider_pager]', array( 'active_callback' => 'business_center_pro_is_slider_enable', 'label' => esc_html__( 'Enable Pager Controls?', 'business-center-pro' ), 'section' => 'business_center_pro_slider_section', 'type' => 'checkbox', ) ); // Add enable slider autoplay setting and control. $wp_customize->add_setting( 'business_center_pro_theme_options[enable_slider_autoplay]', array( 'default' => $options['enable_slider_autoplay'], 'sanitize_callback' => 'business_center_pro_sanitize_checkbox' ) ); $wp_customize->add_control( 'business_center_pro_theme_options[enable_slider_autoplay]', array( 'active_callback' => 'business_center_pro_is_slider_enable', 'label' => esc_html__( 'Enable Autoplay?', 'business-center-pro' ), 'section' => 'business_center_pro_slider_section', 'type' => 'checkbox', ) ); // Make slider draggable setting and control. $wp_customize->add_setting( 'business_center_pro_theme_options[make_slider_draggable]', array( 'default' => $options['make_slider_draggable'], 'sanitize_callback' => 'business_center_pro_sanitize_checkbox' ) ); $wp_customize->add_control( 'business_center_pro_theme_options[make_slider_draggable]', array( 'active_callback' => 'business_center_pro_is_slider_enable', 'label' => esc_html__( 'Make slider draggable?', 'business-center-pro' ), 'section' => 'business_center_pro_slider_section', 'type' => 'checkbox', ) ); // Slider Loop setting and control. $wp_customize->add_setting( 'business_center_pro_theme_options[enable_infinite_sliding]', array( 'default' => $options['enable_infinite_sliding'], 'sanitize_callback' => 'business_center_pro_sanitize_checkbox' ) ); $wp_customize->add_control( 'business_center_pro_theme_options[enable_infinite_sliding]', array( 'active_callback' => 'business_center_pro_is_slider_enable', 'label' => esc_html__( 'Enable infinite sliding?', 'business-center-pro' ), 'description' => esc_html__( 'Checking this will let the slider to slide from last to first.', 'business-center-pro' ), 'section' => 'business_center_pro_slider_section', 'type' => 'checkbox', ) ); // Slider Caption setting and control. $wp_customize->add_setting( 'business_center_pro_theme_options[enable_slider_caption]', array( 'default' => $options['enable_slider_caption'], 'sanitize_callback' => 'business_center_pro_sanitize_checkbox' ) ); $wp_customize->add_control( 'business_center_pro_theme_options[enable_slider_caption]', array( 'active_callback' => 'business_center_pro_is_slider_enable', 'label' => esc_html__( 'Enable slider caption?', 'business-center-pro' ), 'section' => 'business_center_pro_slider_section', 'type' => 'checkbox', ) ); // Slider Caption setting and control. $wp_customize->add_setting( 'business_center_pro_theme_options[slider_scroll_down_id]', array( 'default' => $options['slider_scroll_down_id'], 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'business_center_pro_theme_options[slider_scroll_down_id]', array( 'active_callback' => 'business_center_pro_is_slider_enable', 'label' => esc_html__( 'Scroll Down ID', 'business-center-pro' ), 'description' => esc_html__( 'Input the ID of the section you want to jump to. Note: Keep empty if you want to hide it.', 'business-center-pro' ), 'section' => 'business_center_pro_slider_section', 'type' => 'text', ) ); // Horizontal Line $wp_customize->add_setting( 'business_center_pro_theme_options[slider_basic_controls]', array( 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( new Business_Center_Pro_Customize_Horizontal_Line( $wp_customize, 'business_center_pro_theme_options[slider_basic_controls]', array( 'active_callback' => 'business_center_pro_is_slider_enable', 'section' => 'business_center_pro_slider_section', 'type' => 'hr', ) ) ); /** * Slider content type options. */ $wp_customize->add_setting( 'business_center_pro_theme_options[slider_content_type]', array( 'default' => $options['slider_content_type'], 'sanitize_callback' => 'business_center_pro_sanitize_select', ) ); $wp_customize->add_control( 'business_center_pro_theme_options[slider_content_type]', array( 'active_callback' => 'business_center_pro_is_slider_enable', 'label' => esc_html__( 'Content Type', 'business-center-pro' ), 'section' => 'business_center_pro_slider_section', 'choices' => business_center_pro_default_content_type_options(), 'type' => 'select' ) ); // Nubmer of slider. $wp_customize->add_setting( 'business_center_pro_theme_options[number_of_slider]', array( 'default' => $options['number_of_slider'], 'sanitize_callback' => 'business_center_pro_sanitize_number_range', ) ); $wp_customize->add_control( 'business_center_pro_theme_options[number_of_slider]', array( 'active_callback' => 'business_center_pro_is_slider_demo_disable', 'label' => esc_html__( 'Number of sliders? ( Max: 5 )', 'business-center-pro' ), 'description' => esc_html__( 'Note: Please refresh after changing the value to see the changes.', 'business-center-pro' ), 'section' => 'business_center_pro_slider_section', 'input_attrs' => array( 'min' => 1, 'max' => 5 ), 'type' => 'number' ) ); for ( $i=1; $i <= $options['number_of_slider']; $i++ ) { /** * Page Content Type Options */ // Page Options $wp_customize->add_setting( 'business_center_pro_theme_options[slider_page_'.$i.']', array( 'sanitize_callback' => 'business_center_pro_sanitize_page' ) ); $wp_customize->add_control( 'business_center_pro_theme_options[slider_page_'.$i.']', array( 'active_callback' => 'business_center_pro_is_slider_content_type_page_enable', 'label' => esc_html__( 'Select Page ', 'business-center-pro' ) . $i, 'section' => 'business_center_pro_slider_section', 'type' => 'dropdown-pages', ) ); /** * Custom Content Type Options */ // Title Options $wp_customize->add_setting( 'business_center_pro_theme_options[custom_slider_title_' . $i . ']', array( 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'business_center_pro_theme_options[custom_slider_title_' . $i . ']', array( 'active_callback' => 'business_center_pro_is_slider_content_type_custom_enable', 'label' => esc_html__( 'Slider Title ', 'business-center-pro' ) . $i, 'section' => 'business_center_pro_slider_section', 'type' => 'text', ) ); // Sub title text $wp_customize->add_setting( 'business_center_pro_theme_options[slider_sub_title_'.$i.']', array( 'sanitize_callback' => 'sanitize_text_field', 'default' => esc_html__( 'The life of a designer is a life of fight.', 'business-center-pro' ) ) ); $wp_customize->add_control( 'business_center_pro_theme_options[slider_sub_title_'.$i.']', array( 'active_callback' => 'business_center_pro_is_slider_demo_disable', 'label' => esc_html__( 'Slider Sub Title ', 'business-center-pro' ) . $i, 'section' => 'business_center_pro_slider_section', 'type' => 'text' ) ); // Image Options $wp_customize->add_setting( 'business_center_pro_theme_options[custom_slider_image_' . $i . ']', array( 'sanitize_callback' => 'esc_url', ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'business_center_pro_theme_options[custom_slider_image_' . $i . ']', array( 'active_callback' => 'business_center_pro_is_slider_content_type_custom_enable', 'label' => esc_html__( 'Image ', 'business-center-pro' ) . $i, 'section' => 'business_center_pro_slider_section', ) ) ); // Button text $wp_customize->add_setting( 'business_center_pro_theme_options[slider_btn_text_'.$i.']', array( 'sanitize_callback' => 'sanitize_text_field', 'default' => esc_html__( 'Start Browsing', 'business-center-pro' ) ) ); $wp_customize->add_control( 'business_center_pro_theme_options[slider_btn_text_'.$i.']', array( 'active_callback' => 'business_center_pro_is_slider_demo_disable', 'label' => esc_html__( 'Button Text ', 'business-center-pro' ) . $i, 'section' => 'business_center_pro_slider_section', 'type' => 'text' ) ); // Button Link Options $wp_customize->add_setting( 'business_center_pro_theme_options[custom_slider_link_' . $i . ']', array( 'sanitize_callback' => 'esc_url_raw', 'default' => '#' ) ); $wp_customize->add_control( 'business_center_pro_theme_options[custom_slider_link_' . $i . ']', array( 'active_callback' => 'business_center_pro_is_slider_content_type_custom_enable', 'label' => esc_html__( 'Button Link ', 'business-center-pro' ) . $i, 'section' => 'business_center_pro_slider_section', 'type' => 'url', ) ); // Video Link Options $wp_customize->add_setting( 'business_center_pro_theme_options[slider_video_link_' . $i . ']', array( 'sanitize_callback' => 'esc_url_raw', 'default' => '#' ) ); $wp_customize->add_control( 'business_center_pro_theme_options[slider_video_link_' . $i . ']', array( 'active_callback' => 'business_center_pro_is_slider_demo_disable', 'label' => esc_html__( 'Video Link ', 'business-center-pro' ) . $i, 'section' => 'business_center_pro_slider_section', 'type' => 'url', ) ); // Horizontal Line $wp_customize->add_setting( 'business_center_pro_theme_options[slider_content_type_hr' . $i . ']', array( 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( new Business_Center_Pro_Customize_Horizontal_Line( $wp_customize, 'business_center_pro_theme_options[slider_content_type_hr' . $i . ']', array( 'active_callback' => 'business_center_pro_is_slider_demo_disable', 'section' => 'business_center_pro_slider_section', 'type' => 'hr', ) ) ); } /** * Category Content Type Options */ // Catgegory Options $wp_customize->add_setting( 'business_center_pro_theme_options[slider_category]', array( 'sanitize_callback' => 'business_center_pro_sanitize_tax_checkbox' ) ); $wp_customize->add_control( new Business_Center_Pro_Customize_Control_Checkbox_Multiple( $wp_customize, 'business_center_pro_theme_options[slider_category]', array( 'active_callback' => 'business_center_pro_is_slider_content_type_category_enable', 'label' => esc_html__( 'Select Category', 'business-center-pro' ), 'section' => 'business_center_pro_slider_section', 'type' => 'checkbox-multiple', 'taxonomy' => 'category', ) ) );