add_section( 'bootstrap_coach_benefit_section', array( 'title' => esc_html__( 'Benefit Section', 'bootstrap-coach' ), 'panel' => 'bootstrap_coach_homepage_panel', ) ); $wp_customize->add_setting('bc_benefit_display_option', array( 'sanitize_callback' => 'bootstrap_coach_sanitize_checkbox', 'default' => true )); $wp_customize->add_control(new Bootstrap_Coach_Toggle_Control($wp_customize, 'bc_benefit_display_option', array( 'label' => esc_html__('Hide / Show', 'bootstrap-coach'), 'section' => 'bootstrap_coach_benefit_section', 'settings' => 'bc_benefit_display_option', 'type' => 'toggle', ))); $wp_customize->selective_refresh->add_partial('bc_benefit_display_option', array( 'selector' => '.benefits > .benefits-wrapper', // You can also select a css class )); $wp_customize->add_setting('bc_heading_for_benefit', array( 'sanitize_callback' => 'sanitize_text_field', 'default' => '', 'transport' => 'postMessage', )); $wp_customize->add_control('bc_heading_for_benefit', array( 'label' => esc_html__('Enter Heading', 'bootstrap-coach'), 'section' => 'bootstrap_coach_benefit_section', 'settings' => 'bc_heading_for_benefit', 'type' => 'text', )); $wp_customize->add_setting('bc_content_for_benefit', array( 'sanitize_callback' => 'sanitize_textarea_field', 'default' => '', 'transport' => 'postMessage', )); $wp_customize->add_control('bc_content_for_benefit', array( 'label' => esc_html__('Enter Description', 'bootstrap-coach'), 'section' => 'bootstrap_coach_benefit_section', 'settings' => 'bc_content_for_benefit', 'type' => 'textarea', )); $wp_customize->add_setting( 'bc_image_for_benefit', array( 'sanitize_callback' => 'bootstrap_coach_sanitize_image', 'default-image' => get_template_directory_uri() . '/images/banner.jpg', ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'bc_image_for_benefit', array( 'label' => esc_html__( 'Image', 'bootstrap-coach' ), 'section' => 'bootstrap_coach_benefit_section', 'settings' => 'bc_image_for_benefit', ) ) ); $wp_customize->add_setting( new Bootstrap_Coach_Repeater_Setting( $wp_customize, 'bc_points_for_benefits', array( 'sanitize_callback' => array( 'Bootstrap_Coach_Repeater_Setting', 'sanitize_repeater_setting' ), ) ) ); $wp_customize->add_control( new Bootstrap_Coach_Control_Repeater( $wp_customize, 'bc_points_for_benefits', array( 'section' => 'bootstrap_coach_benefit_section', 'label' => __( 'Add Points ', 'bootstrap-coach' ), 'row_label' => array( 'type' => 'field', 'value' => esc_html__( 'points', 'bootstrap-coach' ), 'field' => 'bc_why_choose_us_title', ), 'fields' => array( 'bc_title_for_benefit' => array( 'type' => 'text', 'label' => __( 'Title', 'bootstrap-coach' ), ), 'bc_percent_for_benefit' => array( 'type' => 'text', 'label' => __( 'Percentage', 'bootstrap-coach' ), ), ), ) ) ); }