add_section( 'slider_settings', array( 'title' => esc_html__( 'Slider Section', 'bizindustries' ), 'description' => '', 'panel' => 'bizindustries_frontpage_settings', 'priority' => 1, 'divider' => 'before', ) ); // Hide/show $wp_customize->add_setting( 'slider_section_enable', array( 'default' => false, 'sanitize_callback' => 'bizindustries_sanitize_checkbox' ) ); $wp_customize->add_control( 'slider_section_enable', array( 'label' => esc_html__( 'Show/hide Slider Section', 'bizindustries' ), 'description' => esc_html__( 'Check/Uncheck this box to show/hide slider section on front page template.', 'bizindustries' ), 'section' => 'slider_settings', 'type' => 'checkbox', 'priority' => 1, ) ); $is_premium = bizindustries_set_to_premium(); // Slides $wp_customize->add_setting( new Bizindustries_Control_Repeater_Setting( $wp_customize, 'bizindustries_slides', array( 'default' => '', 'sanitize_callback' => array( 'Bizindustries_Control_Repeater_Setting', 'sanitize_repeater_setting' ), ) ) ); $wp_customize->add_control( new Bizindustries_Control_Repeater( $wp_customize, 'bizindustries_slides', array( 'section' => 'slider_settings', 'label' => esc_html__( 'Slides', 'bizindustries' ), 'fields' => array( 'subtitle' => array( 'type' => 'text', 'label' => esc_html__( 'Subtitle', 'bizindustries' ), ), 'title' => array( 'type' => 'text', 'label' => esc_html__( 'Title', 'bizindustries' ), ), 'description' => array( 'type' => 'textarea', 'label' => esc_html__( 'Description', 'bizindustries' ), ), 'image' => array( 'type' => 'image', 'label' => __( 'Upload Slide Image', 'bizindustries' ), ), 'btn_1_text' => array( 'type' => 'text', 'label' => esc_html__( 'Button 1 Text', 'bizindustries' ), ), 'btn_1_link' => array( 'type' => 'url', 'label' => esc_html__( 'Button 1 Link', 'bizindustries' ), 'description' => esc_html__( 'Example: https://yoursite.com', 'bizindustries' ), ), 'btn_1_target' => array( 'type' => 'checkbox', 'label' => esc_html__( 'Open button 1 link in new tab', 'bizindustries' ), ), 'btn_2_text' => array( 'type' => 'text', 'label' => esc_html__( 'Button 2 Text', 'bizindustries' ), ), 'btn_2_link' => array( 'type' => 'url', 'label' => esc_html__( 'Button 2 Link', 'bizindustries' ), 'description' => esc_html__( 'Example: https://yoursite.com', 'bizindustries' ), ), 'btn_2_target' => array( 'type' => 'checkbox', 'label' => esc_html__( 'Open button 2 link in new tab', 'bizindustries' ), ), ), 'row_label' => array( 'type' => 'field', 'value' => esc_html__( 'slide', 'bizindustries' ), 'field' => 'subtitle' ), 'choices' => array( 'limit' => $is_premium==false?2:'', ), 'active_callback' => function(){ if( get_theme_mod('slider_section_enable') ){ return true; } else { return false; } }, ) ) ); // Text Alignment $wp_customize->add_setting( 'slider_text_alignment', array( 'default' => 'text-left', 'sanitize_callback' => 'bizindustries_sanitize_choices' ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'slider_text_alignment', array( 'label' => esc_html__('Text Alignment', 'bizindustries'), 'description' => '', 'section' => 'slider_settings', 'type' => 'select', 'choices' => array( 'text-left' => esc_html__('Left','bizindustries'), 'text-center' => esc_html__('Center','bizindustries'), 'text-right' => esc_html__('Right','bizindustries'), ), 'active_callback' => function(){ if(get_theme_mod('slider_section_enable')){ return true; } else { return false; } }, ) ) ); if(class_exists('Bootitems_Core') && bc_fs()->can_use_premium_code() ){ // Slider Autoplay $wp_customize->add_setting( 'slider_autoplay', array( 'sanitize_callback' => 'bizindustries_sanitize_checkbox', 'default' => true, ) ); $wp_customize->add_control( 'slider_autoplay', array( 'type' => 'checkbox', 'label' => esc_html__( 'Slider Autoplay?', 'bizindustries' ), 'section' => 'slider_settings', 'description' => esc_html__( 'Check/Uncheck this box to enable/disable slider autoplay.', 'bizindustries' ), 'active_callback' => function(){ if(get_theme_mod('slider_section_enable')){ return true; } else { return false; } }, ) ); // Slide Duration $wp_customize->add_setting( 'slider_duration', array( 'sanitize_callback' => 'bizindustries_sanitize_number_range', 'validate_callback' => 'bizindustries_validate_duration', 'default' => 5000, ) ); $wp_customize->add_control( 'slider_duration', array( 'label' => esc_html__( 'Slider Duration', 'bizindustries' ), 'description' => esc_html__( 'Set the time in milisecond', 'bizindustries' ), 'section' => 'slider_settings', 'type' => 'number', 'input_attrs' => array( 'min' => 1000, 'max' => 20000, 'step' => 500, ), 'active_callback' => function(){ if(get_theme_mod('slider_section_enable')){ return true; } else { return false; } }, ) ); // Slider Loop $wp_customize->add_setting( 'slider_loop', array( 'sanitize_callback' => 'bizindustries_sanitize_checkbox', 'default' => true, ) ); $wp_customize->add_control( 'slider_loop', array( 'type' => 'checkbox', 'label' => esc_html__( 'Slider loop?', 'bizindustries' ), 'section' => 'slider_settings', 'description' => esc_html__( 'Check/Uncheck this box to enable/disable slider loop.', 'bizindustries' ), 'active_callback' => function(){ if(get_theme_mod('slider_section_enable')){ return true; } else { return false; } }, ) ); // Slider Nav Disable $wp_customize->add_setting( 'slider_nav', array( 'sanitize_callback' => 'bizindustries_sanitize_checkbox', 'default' => true, ) ); $wp_customize->add_control( 'slider_nav', array( 'type' => 'checkbox', 'label' => esc_html__( 'Show slider arrow?', 'bizindustries' ), 'section' => 'slider_settings', 'description' => esc_html__( 'Check/Uncheck this box to show/hide slider arrows.', 'bizindustries' ), 'active_callback' => function(){ if(get_theme_mod('slider_section_enable')){ return true; } else { return false; } }, ) ); // Slider Dots $wp_customize->add_setting( 'slider_dots', array( 'sanitize_callback' => 'bizindustries_sanitize_checkbox', 'default' => true, ) ); $wp_customize->add_control( 'slider_dots', array( 'type' => 'checkbox', 'label' => esc_html__( 'Show slider dots?', 'bizindustries' ), 'section' => 'slider_settings', 'description' => esc_html__( 'Check/Uncheck this box to show/hide slider dots.', 'bizindustries' ), 'active_callback' => function(){ if(get_theme_mod('slider_section_enable')){ return true; } else { return false; } }, ) ); }