add_section( 'reviews_section_settings', array( 'title' => esc_html__( 'Reviews Section', 'bizindustries' ), 'description' => '', 'panel' => 'bizindustries_frontpage_settings', 'priority' => 5, 'divider' => 'before', ) ); $wp_customize->add_setting( 'reviews_sec_enable', array( 'default' => false, 'sanitize_callback' => 'bizindustries_sanitize_checkbox', ) ); $wp_customize->add_control( 'reviews_sec_enable', array( 'label' => esc_html__( 'Show/hide Reviews Section', 'bizindustries' ), 'description' => esc_html__( 'Check/Uncheck this box to show/hide Reviews section on front page.', 'bizindustries' ), 'section' => 'reviews_section_settings', 'settings' => 'reviews_sec_enable', 'type' => 'checkbox', ) ); //Section Heading $wp_customize->add_setting( 'reviews_heading', array( 'default' => esc_html__( 'Reviews', 'bizindustries' ), 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage', ) ); $wp_customize->add_control( 'reviews_heading', array( 'label' => esc_html__( 'Section Heading', 'bizindustries' ), 'section' => 'reviews_section_settings', 'type' => 'text', 'active_callback' => function(){ if(get_theme_mod('reviews_sec_enable')){ return true; } else { return false; } }, ) ); // Section subheading $wp_customize->add_setting( 'reviews_subheading', array( 'default' => esc_html__( 'Client Says', 'bizindustries' ), 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage', ) ); $wp_customize->add_control( 'reviews_subheading', array( 'label' => esc_html__('Section Subheading', 'bizindustries'), 'section' => 'reviews_section_settings', 'type' => 'text', 'active_callback' => function(){ if(get_theme_mod('reviews_sec_enable')){ return true; } else { return false; } }, ) ); // Section subheading $wp_customize->add_setting( 'reviews_description', array( 'default' => esc_html__( 'Top quality services executed by our devoted, yet creative team. We are focused on making you stand out.', 'bizindustries' ), 'sanitize_callback' => 'sanitize_textarea_field', 'transport' => 'postMessage', ) ); $wp_customize->add_control( 'reviews_description', array( 'label' => esc_html__('Section Description', 'bizindustries'), 'section' => 'reviews_section_settings', 'type' => 'textarea', 'active_callback' => function(){ if(get_theme_mod('reviews_sec_enable')){ return true; } else { return false; } }, ) ); $is_premium = bizindustries_set_to_premium(); $wp_customize->add_setting( new Bizindustries_Control_Repeater_Setting( $wp_customize, 'featured_reviewers', array( 'default' => '', 'sanitize_callback' => array( 'Bizindustries_Control_Repeater_Setting', 'sanitize_repeater_setting' ), ) ) ); $wp_customize->add_control( new Bizindustries_Control_Repeater( $wp_customize, 'featured_reviewers', array( 'section' => 'reviews_section_settings', 'label' => esc_html__( 'Reviewers', 'bizindustries' ), 'fields' => array( 'name' => array( 'type' => 'text', 'label' => esc_html__( 'Name', 'bizindustries' ), ), 'quote' => array( 'type' => 'textarea', 'label' => esc_html__( 'Quote', 'bizindustries' ), ), 'position' => array( 'type' => 'text', 'label' => esc_html__( 'Position', 'bizindustries' ), ), 'review_about' => array( 'type' => 'text', 'label' => esc_html__( 'Review About', 'bizindustries' ), ), 'image' => array( 'type' => 'image', 'label' => __( 'Upload Reviewer Image', 'bizindustries' ), 'description' => __( 'Best image size is 300x300', 'bizindustries' ), ), ), 'row_label' => array( 'type' => 'field', 'value' => esc_html__( 'Reviewer', 'bizindustries' ), 'field' => 'name' ), 'choices' => array( 'limit' => $is_premium==false?4:'', ), 'active_callback' => function(){ if( get_theme_mod('reviews_sec_enable') ){ return true; } else { return false; } }, ) ) ); if(class_exists('Bootitems_Core') && bc_fs()->can_use_premium_code() ){ // Enable Carousel $wp_customize->add_setting( 'reviews_carousel_enable', array( 'sanitize_callback' => 'bizindustries_sanitize_checkbox', 'default' => false, 'transport' => 'refresh', ) ); $wp_customize->add_control( 'reviews_carousel_enable', array( 'type' => 'checkbox', 'label' => esc_html__( 'Enable Carousel?', 'bizindustries' ), 'section' => 'reviews_section_settings', 'description' => esc_html__( 'Check/Uncheck this box to enable/disable carousel.', 'bizindustries' ), 'active_callback' => function(){ if(get_theme_mod('reviews_sec_enable')){ return true; } else { return false; } }, ) ); // Carousel Autoplay $wp_customize->add_setting( 'reviews_carousel_autoplay', array( 'sanitize_callback' => 'bizindustries_sanitize_checkbox', 'default' => true, 'transport' => 'refresh', ) ); $wp_customize->add_control( 'reviews_carousel_autoplay', array( 'type' => 'checkbox', 'label' => esc_html__( 'Carousel Autoplay?', 'bizindustries' ), 'section' => 'reviews_section_settings', 'description' => esc_html__( 'Check/Uncheck this box to enable/disable carousel autoplay.', 'bizindustries' ), 'active_callback' => function(){ if(get_theme_mod('reviews_sec_enable') == true && get_theme_mod('reviews_carousel_enable') == true){ return true; } else { return false; } }, ) ); // Slide Duration $wp_customize->add_setting( 'reviews_carousel_duration', array( 'sanitize_callback' => 'bizindustries_sanitize_number_range', 'validate_callback' => 'bizindustries_validate_duration', 'default' => 5000, 'transport' => 'refresh', ) ); $wp_customize->add_control( 'reviews_carousel_duration', array( 'label' => esc_html__( 'Carousel Duration', 'bizindustries' ), 'description' => esc_html__( 'Set the time in milisecond', 'bizindustries' ), 'section' => 'reviews_section_settings', 'type' => 'number', 'active_callback' => function(){ if(get_theme_mod('reviews_sec_enable') == true && get_theme_mod('reviews_carousel_enable') == true){ return true; } else { return false; } }, 'input_attrs' => array( 'min' => 1000, 'max' => 20000, 'step' => 500, ), ) ); // Carousel Loop $wp_customize->add_setting( 'reviews_carousel_loop', array( 'sanitize_callback' => 'bizindustries_sanitize_checkbox', 'default' => true, 'transport' => 'refresh', ) ); $wp_customize->add_control( 'reviews_carousel_loop', array( 'type' => 'checkbox', 'label' => esc_html__( 'Carousel loop?', 'bizindustries' ), 'section' => 'reviews_section_settings', 'description' => esc_html__( 'Check/Uncheck this box to enable/disable carousel loop.', 'bizindustries' ), 'active_callback' => function(){ if(get_theme_mod('reviews_sec_enable') == true && get_theme_mod('reviews_carousel_enable') == true){ return true; } else { return false; } }, ) ); // Carousel Nav Disable $wp_customize->add_setting( 'reviews_carousel_nav', array( 'sanitize_callback' => 'bizindustries_sanitize_checkbox', 'default' => true, 'transport' => 'refresh', ) ); $wp_customize->add_control( 'reviews_carousel_nav', array( 'type' => 'checkbox', 'label' => esc_html__( 'Show carousel arrow?', 'bizindustries' ), 'section' => 'reviews_section_settings', 'description' => esc_html__( 'Check/Uncheck this box to show/hide carousel arrows.', 'bizindustries' ), 'active_callback' => function(){ if(get_theme_mod('reviews_sec_enable') == true && get_theme_mod('reviews_carousel_enable') == true){ return true; } else { return false; } }, ) ); // Carousel Dots $wp_customize->add_setting( 'reviews_carousel_dots', array( 'sanitize_callback' => 'bizindustries_sanitize_checkbox', 'default' => true, 'transport' => 'refresh', ) ); $wp_customize->add_control( 'reviews_carousel_dots', array( 'type' => 'checkbox', 'label' => esc_html__( 'Show carousel dots?', 'bizindustries' ), 'section' => 'reviews_section_settings', 'description' => esc_html__( 'Check/Uncheck this box to show/hide carousel dots.', 'bizindustries' ), 'active_callback' => function(){ if(get_theme_mod('reviews_sec_enable') == true && get_theme_mod('reviews_carousel_enable') == true){ return true; } else { return false; } }, ) ); } // Background color $wp_customize->add_setting( 'reviews_section_bg', array( 'sanitize_callback' => 'sanitize_hex_color_no_hash', 'sanitize_js_callback' => 'maybe_hash_hex_color', 'default' => '', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'reviews_section_bg', array( 'label' => esc_html__( 'Background', 'bizindustries' ), 'description' => '', 'section' => 'reviews_section_settings', 'active_callback' => function(){ if(get_theme_mod('reviews_sec_enable')){ return true; } else { return false; } }, ) ) );