cats = get_categories($options); parent::__construct( $manager, $id, $args ); } /** * Render the content of the category dropdown * * @return HTML */ public function render_content() { if(!empty($this->cats)) { ?> default_data() ); /* FRONT PAGE */ $wp_customize->add_panel( 'frontpage', array( 'priority' => 35, 'capability' => 'edit_theme_options', 'title' => __('FrontPage Sections', 'business-a' ), ) ); /* Woocommerce info section */ $wp_customize->add_section( 'woocommerce_section' , array( 'title' => __('Woocommerce Recommended Plugin', 'business-a' ), 'panel' => 'frontpage', ) ); $wp_customize->add_setting( 'businessa_woo_info', array( 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( new Business_a_Woocommerce_Info( $wp_customize, 'businessa_woo_info', array( 'label' => esc_html__( 'Instructions', 'business-a' ), 'section' => 'woocommerce_section', 'capability' => 'install_plugins', ) ) ); /* Slider Settings */ $wp_customize->add_section( 'slider_section' , array( 'title' => __('Big Slider Section', 'business-a' ), 'panel' => 'frontpage', 'description'=> 'Show your slider in your front page. First you setup your front page. Click Here!
Create a post ( link ) and assign it a category. and Choose a category from given below category setting.
', ) ); // slider enable $wp_customize->add_setting( 'business_option[slider_enable]' , array( 'default' => true, 'sanitize_callback' => 'business_a_sanitize_checkbox', 'type'=>'option' )); $wp_customize->add_control('business_option[slider_enable]' , array( 'label' => __('Enable Slider','business-a' ), 'section' => 'slider_section', 'type'=>'checkbox', ) ); $wp_customize->selective_refresh->add_partial( 'business_option[slider_enable]', array( 'selector' => '#rdn-slider', 'settings' => 'business_option[slider_enable]', ) ); // slider animation type $wp_customize->add_setting( 'business_option[slider_animation_type]' , array( 'default' => 'slide', 'sanitize_callback' => 'sanitize_text_field', 'type'=>'option' )); $wp_customize->add_control('business_option[slider_animation_type]' , array( 'label' => __('Slider Effects','business-a' ), 'section' => 'slider_section', 'type'=>'select', 'choices'=>array( 'slide'=>'Slide', 'fade'=>'Fade', ), ) ); // slider speed $wp_customize->add_setting( 'business_option[slider_speed]' , array( 'default' => 3000, 'sanitize_callback' => 'sanitize_text_field', 'type'=>'option' )); $wp_customize->add_control('business_option[slider_speed]' , array( 'label' => __('Slider animation speed','business-a' ), 'section' => 'slider_section', 'type'=>'select', 'choices'=>array( 500 => 500, 1000 => 1000, 2000 => 2000, 3000 => 3000, 4000 => 4000, 5000 => 5000, 6000 => 6000, 7000 => 7000, 8000 => 8000, 9000 => 9000, 10000 => 10000, ), ) ); // slider cat $wp_customize->add_setting('business_option[slider_cat]',array( 'default' => 1, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field', 'type'=>'option', ) ); $wp_customize->add_control( new business_a_category_dropdown_custom_control( $wp_customize, 'business_option[slider_cat]', array( 'label' => __('Category','business-a' ), 'section' => 'slider_section', 'settings' => 'business_option[slider_cat]', ) ) ); /* Service Settings */ $wp_customize->add_section( 'service_section' , array( 'title' => __('Service', 'business-a' ), 'panel' => 'frontpage', 'description'=> 'Show your services in your front page. First you setup your front page. Click Here!', ) ); // service section enable/disable $wp_customize->add_setting( 'business_option[service_section_enable]' , array( 'default' => true, 'sanitize_callback' => 'business_a_sanitize_checkbox', 'type'=>'option' )); $wp_customize->add_control('business_option[service_section_enable]' , array( 'label' => __('Enable Service Section','business-a' ), 'section' => 'service_section', 'type'=>'checkbox', ) ); // service section title $wp_customize->add_setting( 'business_option[service_section_title]' , array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field', 'type'=>'option' )); $wp_customize->add_control('business_option[service_section_title]' , array( 'label' => __('Service Section Title','business-a' ), 'section' => 'service_section', 'type'=>'text', ) ); $wp_customize->selective_refresh->add_partial( 'business_option[service_section_title]', array( 'selector' => '#service .section-title', 'settings' => 'business_option[service_section_title]', ) ); // service section description $wp_customize->add_setting( 'business_option[service_section_description]' , array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field', 'type'=>'option' )); $wp_customize->add_control('business_option[service_section_description]' , array( 'label' => __('Service Section Description','business-a' ), 'section' => 'service_section', 'type'=>'text', ) ); $wp_customize->selective_refresh->add_partial( 'business_option[service_section_description]', array( 'selector' => '#service .section-desc', 'settings' => 'business_option[service_section_description]', ) ); // service section background color $wp_customize->add_setting( 'business_option[service_section_backgorund_color]' , array( 'default' => '#ffffff', 'sanitize_callback' => 'sanitize_text_field', 'type'=>'option' )); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize , 'business_option[service_section_backgorund_color]' , array( 'label' => __('Section Background Color','business-a' ), 'section' => 'service_section', 'settings'=>'business_option[service_section_backgorund_color]' ) ) ); // service section image $wp_customize->add_setting( 'business_option[service_section_image]' , array( 'default' => '', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'esc_url_raw', 'type'=>'option' ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize , 'business_option[service_section_image]' , array( 'label' => __( 'Service Section Image', 'business-a' ), 'description'=> __('Upload your background image minimum size ( 1600 x 900 ).','business-a'), 'section' => 'service_section', ) ) ); $wp_customize->add_setting( 'business_option[service_section_image_repeat]', array( 'default' => 'repeat', 'sanitize_callback' => 'sanitize_text_field', 'type'=>'option' ) ); $wp_customize->add_control( 'business_option[service_section_image_repeat]', array( 'label' => __( 'Background Repeat', 'business-a' ), 'section' => 'service_section', 'settings' => 'business_option[service_section_image_repeat]', 'type' => 'select', 'choices' => array( 'no-repeat' => __('No Repeat','business-a'), 'repeat' => __('Tile','business-a'), 'repeat-x' => __('Tile Horizontally','business-a'), 'repeat-y' => __('Tile Vertically','business-a'), ), ) ); if ( class_exists( 'Businessa_Repeater' ) ) { $wp_customize->add_setting( 'service_section_contents', array( 'sanitize_callback' => 'businessa_repeater_sanitize', 'transport' => 'postMessage', ) ); $wp_customize->add_control( new Businessa_Repeater( $wp_customize, 'service_section_contents', array( 'label' => esc_html__( 'Service Content', 'business-a' ), 'section'=> 'service_section', 'add_field_label' => esc_html__( 'Add new Service', 'business-a' ), 'item_name' => esc_html__( 'Service', 'business-a' ), 'max_item' => 3, 'customizer_repeater_icon_control' => true, 'customizer_repeater_title_control' => true, 'customizer_repeater_text_control' => true, 'customizer_repeater_link_control' => true, 'customizer_repeater_color_control' => false, ) ) ); } if ( class_exists( 'woocommerce' ) ){ /* shop Settings */ $wp_customize->add_section( 'shop_sections' , array( 'title' => __('Shop', 'business-a' ), 'panel' => 'frontpage' ) ); // shop section enable/disable $wp_customize->add_setting( 'business_option[shop_section_enable]' , array( 'default' => true, 'sanitize_callback' => 'business_a_sanitize_checkbox', 'type'=>'option' )); $wp_customize->add_control('business_option[shop_section_enable]' , array( 'label' => __('Enable Shop Section','business-a' ), 'section' => 'shop_sections', 'type'=>'checkbox', ) ); // shop section title $wp_customize->add_setting( 'business_option[shop_section_title]' , array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field', 'type'=>'option' )); $wp_customize->add_control('business_option[shop_section_title]' , array( 'label' => __('Section Title','business-a' ), 'section' => 'shop_sections', 'type'=>'text', ) ); $wp_customize->selective_refresh->add_partial( 'business_option[shop_section_title]', array( 'selector' => '#shop .section-title', 'settings' => 'business_option[shop_section_title]', ) ); // shop section description $wp_customize->add_setting( 'business_option[shop_section_description]' , array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field', 'type'=>'option' )); $wp_customize->add_control('business_option[shop_section_description]' , array( 'label' => __('Section Subtitle','business-a' ), 'section' => 'shop_sections', 'type'=>'text', ) ); $wp_customize->selective_refresh->add_partial( 'business_option[shop_section_description]', array( 'selector' => '#shop .section-desc', 'settings' => 'business_option[shop_section_description]', ) ); // shop no of show $wp_customize->add_setting( 'business_option[shop_no_of_show]' , array( 'default' => 4, 'sanitize_callback' => 'sanitize_text_field', 'type'=>'option' )); $wp_customize->add_control('business_option[shop_no_of_show]' , array( 'label' => __('Products No Of Show','business-a' ), 'section' => 'shop_sections', 'type'=>'number', ) ); // shop section background color $wp_customize->add_setting( 'business_option[shop_section_backgorund_color]' , array( 'default' => '#ffffff', 'sanitize_callback' => 'sanitize_text_field', 'type'=>'option' )); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize , 'business_option[shop_section_backgorund_color]' , array( 'label' => __('Section Background Color','business-a' ), 'section' => 'shop_sections', 'settings'=>'business_option[shop_section_backgorund_color]' ) ) ); // Shop section image $wp_customize->add_setting( 'business_option[shop_section_image]' , array( 'default' => '', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'esc_url_raw', 'type'=>'option' ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize , 'business_option[shop_section_image]' , array( 'label' => __( 'Shop Section Image', 'business-a' ), 'section' => 'shop_sections', ) ) ); $wp_customize->add_setting( 'business_option[shop_section_image_repeat]', array( 'default' => 'repeat', 'sanitize_callback' => 'sanitize_text_field', 'type'=>'option' ) ); $wp_customize->add_control( 'business_option[shop_section_image_repeat]', array( 'label' => __( 'Background Repeat', 'business-a' ), 'section' => 'shop_sections', 'settings' => 'business_option[shop_section_image_repeat]', 'type' => 'select', 'choices' => array( 'no-repeat' => __('No Repeat','business-a'), 'repeat' => __('Tile','business-a'), 'repeat-x' => __('Tile Horizontally','business-a'), 'repeat-y' => __('Tile Vertically','business-a'), ), ) ); } /* News Settings */ $wp_customize->add_section( 'news_section' , array( 'title' => __('Blog', 'business-a' ), 'panel' => 'frontpage', 'description'=> 'Show your latest news in your front page. First you setup your front page. Click Here!If you want to access latest blogs in FrontPage. Please create a post and add a category in this post. And then select this category given below News Category setting.
', ) ); // news section enable/disable $wp_customize->add_setting( 'business_option[news_section_enable]' , array( 'default' => true, 'sanitize_callback' => 'business_a_sanitize_checkbox', 'type'=>'option' )); $wp_customize->add_control('business_option[news_section_enable]' , array( 'label' => __('Enable News Section','business-a' ), 'section' => 'news_section', 'type'=>'checkbox', ) ); // news section title $wp_customize->add_setting( 'business_option[news_section_title]' , array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field', 'type'=>'option' )); $wp_customize->add_control('business_option[news_section_title]' , array( 'label' => __('News Section Title','business-a' ), 'section' => 'news_section', 'type'=>'text', ) ); $wp_customize->selective_refresh->add_partial( 'business_option[news_section_title]', array( 'selector' => '#news .section-title', 'settings' => 'business_option[news_section_title]', ) ); // news section description $wp_customize->add_setting( 'business_option[news_section_description]' , array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field', 'type'=>'option' )); $wp_customize->add_control('business_option[news_section_description]' , array( 'label' => __('News Section Description','business-a' ), 'section' => 'news_section', 'type'=>'text', ) ); $wp_customize->selective_refresh->add_partial( 'business_option[news_section_description]', array( 'selector' => '#news .section-desc', 'settings' => 'business_option[news_section_description]', ) ); // news no of show $wp_customize->add_setting( 'business_option[news_no_of_show]' , array( 'default' => 4, 'sanitize_callback' => 'sanitize_text_field', 'type'=>'option' )); $wp_customize->add_control('business_option[news_no_of_show]' , array( 'label' => __('News No Of Show','business-a' ), 'section' => 'news_section', 'type'=>'number', ) ); // news category show $wp_customize->add_setting( 'business_option[news_category_show]' , array( 'default' => 1, 'sanitize_callback' => 'sanitize_text_field', 'type'=>'option' )); $wp_customize->add_control('business_option[news_category_show]' , array( 'label' => __('News Category Show','business-a' ), 'section' => 'news_section', 'type'=>'select', 'choices'=> business_a_get_post_category(), ) ); // news section background color $wp_customize->add_setting( 'business_option[news_section_backgorund_color]' , array( 'default' => '#3c3c3c', 'sanitize_callback' => 'sanitize_text_field', 'type'=>'option' )); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize , 'business_option[news_section_backgorund_color]' , array( 'label' => __('Section Background Color','business-a' ), 'section' => 'news_section', 'settings'=>'business_option[news_section_backgorund_color]' ) ) ); // News section image $wp_customize->add_setting( 'business_option[news_section_image]' , array( 'default' => '', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'esc_url_raw', 'type'=>'option' ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize , 'business_option[news_section_image]' , array( 'label' => __( 'News Section Image', 'business-a' ), 'description'=> __('Upload your background image minimum size ( 1600 x 900 ).','business-a'), 'section' => 'news_section', ) ) ); $wp_customize->add_setting( 'business_option[news_section_image_repeat]', array( 'default' => 'repeat', 'sanitize_callback' => 'sanitize_text_field', 'type'=>'option' ) ); $wp_customize->add_control( 'business_option[news_section_image_repeat]', array( 'label' => __( 'Background Repeat', 'business-a' ), 'section' => 'news_section', 'settings' => 'business_option[news_section_image_repeat]', 'type' => 'select', 'choices' => array( 'no-repeat' => __('No Repeat','business-a'), 'repeat' => __('Tile','business-a'), 'repeat-x' => __('Tile Horizontally','business-a'), 'repeat-y' => __('Tile Vertically','business-a'), ), ) ); /* Team Settings */ $wp_customize->add_section( 'team_section' , array( 'title' => __('Team', 'business-a'), 'panel' => 'frontpage' ) ); $wp_customize->add_setting( 'business_option[team_section_enable]' , array( 'default' => true, 'sanitize_callback' => 'sanitize_text_field', 'type'=>'option' )); $wp_customize->add_control('business_option[team_section_enable]' , array( 'label' => __('Enable Team Section','business-a'), 'section' => 'team_section', 'type'=>'checkbox', ) ); $wp_customize->add_setting( 'business_option[team_section_title]' , array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field', 'type'=>'option' )); $wp_customize->add_control('business_option[team_section_title]' , array( 'label' => __('Section Title','business-a'), 'section' => 'team_section', 'type'=>'text', ) ); $wp_customize->selective_refresh->add_partial( 'business_option[team_section_title]', array( 'selector' => '#team .section-title', 'settings' => 'business_option[team_section_title]', ) ); $wp_customize->add_setting( 'business_option[team_section_description]' , array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field', 'type'=>'option' )); $wp_customize->add_control('business_option[team_section_description]' , array( 'label' => __('Section Subtitle','business-a'), 'section' => 'team_section', 'type'=>'textarea', ) ); $wp_customize->selective_refresh->add_partial( 'business_option[team_section_description]', array( 'selector' => '#team .section-desc', 'settings' => 'business_option[team_section_description]', ) ); $wp_customize->add_setting( 'business_option[team_section_backgorund_color]' , array( 'default' => '#ffffff', 'sanitize_callback' => 'sanitize_text_field', 'type'=>'option' )); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize , 'business_option[team_section_backgorund_color]' , array( 'label' => __('Background Color','business-a'), 'section' => 'team_section', 'settings'=>'business_option[team_section_backgorund_color]' ) ) ); $wp_customize->add_setting( 'business_option[team_section_image]' , array( 'default' => '', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'esc_url_raw', 'type'=>'option' ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize , 'business_option[team_section_image]' , array( 'label' => __( 'Background Image', 'business-a' ), 'section' => 'team_section', ) ) ); $wp_customize->add_setting( 'business_option[team_section_image_repeat]', array( 'default' => 'repeat', 'sanitize_callback' => 'sanitize_text_field', 'type'=>'option' ) ); $wp_customize->add_control( 'business_option[team_section_image_repeat]', array( 'label' => __( 'Background Repeat', 'business-a' ), 'section' => 'team_section', 'settings' => 'business_option[team_section_image_repeat]', 'type' => 'select', 'choices' => array( 'no-repeat' => __('No Repeat','business-a'), 'repeat' => __('Tile','business-a'), 'repeat-x' => __('Tile Horizontally','business-a'), 'repeat-y' => __('Tile Vertically','business-a'), ), ) ); if ( class_exists( 'Businessa_Repeater' ) ) { $wp_customize->add_setting( 'team_section_contents', array( 'sanitize_callback' => 'businessa_repeater_sanitize', 'transport' => 'postMessage', ) ); $wp_customize->add_control( new Businessa_Repeater( $wp_customize, 'team_section_contents', array( 'label' => esc_html__( 'Team Content', 'business-a' ), 'section' => 'team_section', 'add_field_label' => esc_html__( 'Add new Team Member', 'business-a' ), 'item_name' => esc_html__( 'Team Member', 'business-a' ), 'max_item' => 3, 'customizer_repeater_image_control' => true, 'customizer_repeater_title_control' => true, 'customizer_repeater_subtitle_control' => true, 'customizer_repeater_text_control' => true, 'customizer_repeater_link_control' => true, 'customizer_repeater_repeater_control' => false, ) ) ); } /* Testimonial Settings */ $wp_customize->add_section( 'testimonial_section' , array( 'title' => __('Testimonial', 'business-a'), 'panel' => 'frontpage' ) ); $wp_customize->add_setting( 'business_option[testimonial_section_enable]' , array( 'default' => true, 'sanitize_callback' => 'sanitize_text_field', 'type'=>'option' )); $wp_customize->add_control('business_option[testimonial_section_enable]' , array( 'label' => __('Enable Testimonial Section','business-a'), 'section' => 'testimonial_section', 'type'=>'checkbox', ) ); $wp_customize->add_setting( 'business_option[testimonial_section_title]' , array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field', 'type'=>'option' )); $wp_customize->add_control('business_option[testimonial_section_title]' , array( 'label' => __('Section Title','business-a'), 'section' => 'testimonial_section', 'type'=>'text', ) ); $wp_customize->selective_refresh->add_partial( 'business_option[testimonial_section_title]', array( 'selector' => '#testimonial .section-title', 'settings' => 'business_option[testimonial_section_title]', ) ); $wp_customize->add_setting( 'business_option[testimonial_section_description]' , array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field', 'type'=>'option' )); $wp_customize->add_control('business_option[testimonial_section_description]' , array( 'label' => __('Section Subtitle','business-a'), 'section' => 'testimonial_section', 'type'=>'textarea', ) ); $wp_customize->selective_refresh->add_partial( 'business_option[testimonial_section_description]', array( 'selector' => '#testimonial .section-desc', 'settings' => 'business_option[testimonial_section_description]', ) ); $wp_customize->add_setting( 'business_option[testimonial_section_backgorund_color]' , array( 'default' => '#ffffff', 'sanitize_callback' => 'sanitize_text_field', 'type'=>'option' )); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize , 'business_option[testimonial_section_backgorund_color]' , array( 'label' => __('Background Color','business-a'), 'section' => 'testimonial_section', 'settings'=>'business_option[testimonial_section_backgorund_color]' ) ) ); $wp_customize->add_setting( 'business_option[testimonial_section_image]' , array( 'default' => '', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'esc_url_raw', 'type'=>'option' ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize , 'business_option[testimonial_section_image]' , array( 'label' => __( 'Background Image', 'business-a' ), 'section' => 'testimonial_section', ) ) ); $wp_customize->add_setting( 'business_option[testimonial_section_image_repeat]', array( 'default' => 'repeat', 'sanitize_callback' => 'sanitize_text_field', 'type'=>'option' ) ); $wp_customize->add_control( 'business_option[testimonial_section_image_repeat]', array( 'label' => __( 'Background Repeat', 'business-a' ), 'section' => 'testimonial_section', 'settings' => 'business_option[testimonial_section_image_repeat]', 'type' => 'select', 'choices' => array( 'no-repeat' => __('No Repeat','business-a'), 'repeat' => __('Tile','business-a'), 'repeat-x' => __('Tile Horizontally','business-a'), 'repeat-y' => __('Tile Vertically','business-a'), ), ) ); if ( class_exists( 'Businessa_Repeater' ) ) { $wp_customize->add_setting( 'testimonial_section_contents', array( 'sanitize_callback' => 'businessa_repeater_sanitize', 'transport' => 'postMessage', ) ); $wp_customize->add_control( new Businessa_Repeater( $wp_customize, 'testimonial_section_contents', array( 'label' => esc_html__( 'Testimonial Content', 'business-a' ), 'section' => 'testimonial_section', 'add_field_label' => esc_html__( 'Add new Testimonial', 'business-a' ), 'item_name' => esc_html__( 'Testimonial', 'business-a' ), 'max_item' => 3, 'customizer_repeater_image_control' => true, 'customizer_repeater_title_control' => true, 'customizer_repeater_subtitle_control' => true, 'customizer_repeater_text_control' => true, 'customizer_repeater_link_control' => true, 'customizer_repeater_repeater_control' => false, ) ) ); } /* Contact Settings */ $wp_customize->add_section( 'contact_section' , array( 'title' => __('Contact', 'business-a' ), 'panel' => 'frontpage', 'description'=> 'Show your contact information in your front page. First you setup your front page. Click Here!To add your contact form. Please install Contact Form 7 plugin. And copy contact form shortcode and add this shorcode given below Contact Form 7 Shortcode settings.
', ) ); // Contact section enable/disable $wp_customize->add_setting( 'business_option[contact_section_enable]' , array( 'default' => true, 'sanitize_callback' => 'business_a_sanitize_checkbox', 'type'=>'option' )); $wp_customize->add_control('business_option[contact_section_enable]' , array( 'label' => __('Enable Contact Section', 'business-a'), 'section' => 'contact_section', 'type'=>'checkbox', ) ); // Contact section title $wp_customize->add_setting( 'business_option[contact_section_title]' , array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field', 'type'=>'option' )); $wp_customize->add_control('business_option[contact_section_title]' , array( 'label' => __('Contact Section Title', 'business-a'), 'section' => 'contact_section', 'type'=>'text', ) ); $wp_customize->selective_refresh->add_partial( 'business_option[contact_section_title]', array( 'selector' => '#contact .contact-section-title', 'settings' => 'business_option[contact_section_title]', ) ); // Contact section description $wp_customize->add_setting( 'business_option[contact_section_description]' , array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field', 'type'=>'option' )); $wp_customize->add_control('business_option[contact_section_description]' , array( 'label' => __('Contact Section Description', 'business-a'), 'section' => 'contact_section', 'type'=>'text', ) ); $wp_customize->selective_refresh->add_partial( 'business_option[contact_section_description]', array( 'selector' => '#contact .contact-section-desc', 'settings' => 'business_option[contact_section_description]', ) ); $wp_customize->add_setting( 'business_option[contact_leftinfo_text1]' , array( 'default' => $option['contact_leftinfo_text1'], 'sanitize_callback' => 'sanitize_text_field', 'type'=>'option' )); $wp_customize->add_control('business_option[contact_leftinfo_text1]' , array( 'label' => __('Location:','business-a'), 'section' => 'contact_section', 'type'=>'text', ) ); $wp_customize->selective_refresh->add_partial( 'business_option[contact_leftinfo_text1]', array( 'selector' => '#contact .contact-info-section-area li:first', 'settings' => 'business_option[contact_leftinfo_text1]', ) ); $wp_customize->add_setting( 'business_option[contact_leftinfo_text2]' , array( 'default' => $option['contact_leftinfo_text2'], 'sanitize_callback' => 'sanitize_text_field', 'type'=>'option' )); $wp_customize->add_control('business_option[contact_leftinfo_text2]' , array( 'label' => __('Phone No.:','business-a'), 'section' => 'contact_section', 'type'=>'text', ) ); $wp_customize->add_setting( 'business_option[contact_leftinfo_text3]' , array( 'default' => $option['contact_leftinfo_text3'], 'sanitize_callback' => 'sanitize_text_field', 'type'=>'option' )); $wp_customize->add_control('business_option[contact_leftinfo_text3]' , array( 'label' => __('Email Address:','business-a'), 'section' => 'contact_section', 'type'=>'text', ) ); $wp_customize->selective_refresh->add_partial( 'business_option[contact_leftinfo_text3]', array( 'selector' => '#contact .contact-info-section-area li:last', 'settings' => 'business_option[contact_leftinfo_text3]', ) ); /* Contact Form & info section */ $wp_customize->add_setting( 'businessa_contactform_info', array( 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( new Business_a_Contactform_Info( $wp_customize, 'businessa_contactform_info', array( 'label' => esc_html__( 'Instructions', 'business-a' ), 'section' => 'contact_section', 'capability' => 'install_plugins', ) ) ); $wp_customize->add_setting( 'business_option[contact_leftinfo_heading]' , array( 'default' => $option['contact_leftinfo_heading'], 'sanitize_callback' => 'sanitize_text_field', 'type'=>'option' )); $wp_customize->add_control('business_option[contact_leftinfo_heading]' , array( 'label' => __('Contact Form Title','business-a'), 'section' => 'contact_section', 'type'=>'text', ) ); $wp_customize->selective_refresh->add_partial( 'business_option[contact_leftinfo_heading]', array( 'selector' => '#contact .contact-form-area .contactPageSectionTitle', 'settings' => 'business_option[contact_leftinfo_heading]', ) ); $wp_customize->add_setting( 'business_option[contact_contactform_shortcode]' , array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field', 'type'=>'option' )); $wp_customize->add_control('business_option[contact_contactform_shortcode]' , array( 'label' => __('Contact Form 7 Shortcode:', 'business-a'), 'section' => 'contact_section', 'type'=>'textarea', ) ); } add_action( 'customize_register', 'business_a_homepage_settings_fucntion' ); function business_a_get_post_category(){ $cats = get_categories(); $arr = array(); foreach($cats as $cat){ $arr[$cat->term_id] = $cat->name; } return $arr; } /** * Sanitize repeater control. */ function businessa_repeater_sanitize( $input ) { $input_decoded = json_decode( $input,true ); if ( ! empty( $input_decoded ) ) { foreach ( $input_decoded as $boxk => $box ) { foreach ( $box as $key => $value ) { $input_decoded[ $boxk ][ $key ] = wp_kses_post( force_balance_tags( $value ) ); } } return json_encode( $input_decoded ); } return $input; }