add_section( 'testimonial_section_settings', array( 'title' => esc_html__( 'Testimonial Section', 'bizprime' ), 'priority' => 200, 'capability' => 'edit_theme_options', 'panel' => 'theme_front_page_section', ) ); // Setting - show-testimonial-section. $wp_customize->add_setting( 'theme_options[show-testimonial-section]', array( 'default' => $default['show-testimonial-section'], 'capability' => 'edit_theme_options', 'sanitize_callback' => 'bizprime_sanitize_checkbox', ) ); $wp_customize->add_control( 'theme_options[show-testimonial-section]', array( 'label' => esc_html__( 'Enable Testimonial', 'bizprime' ), 'section' => 'testimonial_section_settings', 'type' => 'checkbox', 'priority' => 100, ) ); /*No of testimonial*/ $wp_customize->add_setting( 'theme_options[number-of-home-testimonial]', array( 'default' => $default['number-of-home-testimonial'], 'capability' => 'edit_theme_options', 'sanitize_callback' => 'bizprime_sanitize_select', ) ); $wp_customize->add_control( 'theme_options[number-of-home-testimonial]', array( 'label' => esc_html__( 'Select no of testimonial', 'bizprime' ), 'description' => __( 'If you are using selection "from page" option please refresh to get actual no of page', 'bizprime' ), 'section' => 'testimonial_section_settings', 'choices' => array( '1' => __( '1', 'bizprime' ), '2' => __( '2', 'bizprime' ), '3' => __( '3', 'bizprime' ), '4' => __( '4', 'bizprime' ), '5' => __( '5', 'bizprime' ), '6' => __( '6', 'bizprime' ), ), 'type' => 'select', 'priority' => 105, ) ); /*content excerpt in testimonial*/ $wp_customize->add_setting( 'theme_options[number-of-content-home-testimonial]', array( 'default' => $default['number-of-content-home-testimonial'], 'capability' => 'edit_theme_options', 'sanitize_callback' => 'bizprime_sanitize_positive_integer', ) ); $wp_customize->add_control( 'theme_options[number-of-content-home-testimonial]', array( 'label' => esc_html__( 'Select no words of testimonial', 'bizprime' ), 'section' => 'testimonial_section_settings', 'type' => 'number', 'priority' => 110, 'input_attrs' => array( 'min' => 1, 'max' => 200, 'style' => 'width: 150px;' ), ) ); // Setting - select-testimonial-from. $wp_customize->add_setting( 'theme_options[select-testimonial-from]', array( 'default' => $default['select-testimonial-from'], 'capability' => 'edit_theme_options', 'sanitize_callback' => 'bizprime_sanitize_select', ) ); $wp_customize->add_control( 'theme_options[select-testimonial-from]', array( 'label' => esc_html__( 'Select testimonial From', 'bizprime' ), 'section' => 'testimonial_section_settings', 'type' => 'select', 'choices' => array( 'from-page' => __( 'Page', 'bizprime' ), 'from-category' => __( 'Category', 'bizprime' ) ), 'priority' => 110, ) ); for ( $i=1; $i <= bizprime_get_option( 'number-of-home-testimonial' ) ; $i++ ) { $wp_customize->add_setting( 'theme_options[select-page-for-testimonial_'. $i .']', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'bizprime_sanitize_dropdown_pages', ) ); $wp_customize->add_control( 'theme_options[select-page-for-testimonial_'. $i .']', array( 'input_attrs' => array( 'style' => 'width: 50px;' ), 'label' => __( 'testimonial From Page', 'bizprime' ) . ' - ' . $i , 'priority' => '120' . $i, 'section' => 'testimonial_section_settings', 'type' => 'dropdown-pages', 'priority' => 120, 'active_callback' => 'bizprime_is_select_page_testimonial', ) ); } // Setting - drop down category for testimonial. $wp_customize->add_setting( 'theme_options[select-category-for-testimonial]', array( 'default' => $default['select-category-for-testimonial'], 'capability' => 'edit_theme_options', 'sanitize_callback' => 'absint', ) ); $wp_customize->add_control( new Bizprime_Dropdown_Taxonomies_Control( $wp_customize, 'theme_options[select-category-for-testimonial]', array( 'label' => __( 'Category for Testimonial ', 'bizprime' ), 'description' => __( 'Select category to be shown on tab ', 'bizprime' ), 'section' => 'testimonial_section_settings', 'type' => 'dropdown-taxonomies', 'taxonomy' => 'category', 'priority' => 130, 'active_callback' => 'bizprime_is_select_cat_testimonial', ) ) );