add_section( 'reasons_section_settings', array( 'title' => esc_html__( 'Why Choose Section', 'bizindustries' ), 'description' => '', 'panel' => 'bizindustries_frontpage_settings', 'priority' => 4, ) ); $wp_customize->add_setting( 'whysec_enable', array( 'default' => false, 'sanitize_callback' => 'bizindustries_sanitize_checkbox', ) ); $wp_customize->add_control( 'whysec_enable', array( 'label' => esc_html__( 'Show/hide why choose section', 'bizindustries' ), 'description' => esc_html__( 'Check/Uncheck this box to show/hide why choose section on front page.', 'bizindustries' ), 'section' => 'reasons_section_settings', 'type' => 'checkbox', 'priority' => 1 ) ); //Section Heading $wp_customize->add_setting( 'why_section_title', array( 'default' => esc_html__('Why Choose', 'bizindustries'), 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage' ) ); $wp_customize->add_control( 'why_section_title', array( 'label' => esc_html__( 'Section Heading', 'bizindustries' ), 'section' => 'reasons_section_settings', 'type' => 'text', 'active_callback' => function(){ if(get_theme_mod('whysec_enable')){ return true; } else { return false; } }, 'priority'=> 2, ) ); // Section subheading $wp_customize->add_setting( 'why_section_subtitle', array( 'default' => esc_html__('The Reasons', 'bizindustries'), 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage' ) ); $wp_customize->add_control( 'why_section_subtitle', array( 'label' => esc_html__('Section Subheading', 'bizindustries'), 'description'=> '', 'section' => 'reasons_section_settings', 'type' => 'text', 'active_callback' => function(){ if(get_theme_mod('whysec_enable')){ return true; } else { return false; } }, 'priority' => 3, ) ); // Section Description $wp_customize->add_setting( 'why_section_desc', array( 'default' => __('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( 'why_section_desc', array( 'label' => esc_html__('Section Description', 'bizindustries'), 'description'=> '', 'section' => 'reasons_section_settings', 'type' => 'textarea', 'active_callback' => function(){ if(get_theme_mod('whysec_enable')){ return true; } else { return false; } }, 'priority' => 3, ) ); $is_premium = bizindustries_set_to_premium(); // Reasons $wp_customize->add_setting( new Bizindustries_Control_Repeater_Setting( $wp_customize, 'bizindustries_reasons', array( 'default' => '', 'sanitize_callback' => array( 'Bizindustries_Control_Repeater_Setting', 'sanitize_repeater_setting' ), ) ) ); $wp_customize->add_control( new Bizindustries_Control_Repeater( $wp_customize, 'bizindustries_reasons', array( 'section' => 'reasons_section_settings', 'label' => esc_html__( 'Reasons', 'bizindustries' ), 'fields' => array( 'icon' => array( 'type' => 'text', 'label' => esc_html__( 'Icon', 'bizindustries' ), 'description' => esc_html__('Select a icon from https://fontawesome.com/v4.7/icons/ and enter class name. Example- fa-bitbucket', 'bizindustries'), ), 'title' => array( 'type' => 'text', 'label' => esc_html__( 'Title', 'bizindustries' ), ), 'description' => array( 'type' => 'textarea', 'label' => esc_html__( 'Descrition', 'bizindustries' ), ), ), 'row_label' => array( 'type' => 'field', 'value' => esc_html__( 'reason', 'bizindustries' ), 'field' => 'title' ), 'choices' => array( 'limit' => $is_premium==false?4:'', ), 'active_callback' => function(){ if(get_theme_mod('whysec_enable')){ return true; } else { return false; } }, ) ) ); // Background color $wp_customize->add_setting( 'reasons_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, 'reasons_section_bg', array( 'label' => esc_html__( 'Background', 'bizindustries' ), 'description' => '', 'section' => 'reasons_section_settings', 'active_callback' => function(){ if(get_theme_mod('whysec_enable')){ return true; } else { return false; } }, ) ) );