get_setting( 'blogname' )->transport = 'postMessage'; $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage'; $wp_customize->add_panel('buzzstore_general_settings', array( 'capabitity' => 'edit_theme_options', 'priority' => 4, 'title' => __('General Settings', 'buzzstore') )); $wp_customize->get_section('title_tagline' )->panel = 'buzzstore_general_settings'; $wp_customize->get_section('title_tagline' )->priority = 1; $wp_customize->get_section('colors' )->panel = 'buzzstore_general_settings'; $wp_customize->get_section('colors')->title = __( 'Themes Colors', 'buzzstore' ); $wp_customize->get_section('colors' )->priority = 3; $wp_customize->get_section('background_image' )->panel = 'buzzstore_general_settings'; $wp_customize->get_section('background_image' )->priority = 4; /** * Custom Css Settings */ $wp_customize->add_section('buzzstore_custom_css_setting', array( 'priority' => 5, 'title' => __('Enter Custom CSS', 'buzzstore'), 'panel' => 'buzzstore_general_settings' )); $wp_customize->add_setting('buzzstore_custom_css', array( 'default' => '', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'wp_filter_nohtml_kses', )); $wp_customize->add_control('buzzstore_custom_css', array( 'type' => 'textarea', 'label' => __('Write your custom css', 'buzzstore'), 'section' => 'buzzstore_custom_css_setting', 'settings' => 'buzzstore_custom_css' )); $buzz_imagepath = get_template_directory_uri() . '/assets/images/'; /************************************************************************************ ** Top Header Settings Options *************************************************************************************/ $wp_customize->add_panel('buzzstore_top_header_section', array( 'capabitity' => 'edit_theme_options', 'description' => __('Change the top header settings here as you want', 'buzzstore'), 'priority' => 5, 'title' => __('Top Header Settings', 'buzzstore') )); /** * Top Header General Settings Section */ $wp_customize->add_section('buzzstore_top_header_general_settings', array( 'title' => __('Top Header General Settings', 'buzzstore'), 'panel' => 'buzzstore_top_header_section', 'priority' => 1, )); $wp_customize->add_setting('buzzstore_top_header_display_options', array( 'default' => 'yes', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'buzzstore_radio_sanitize' // done )); $wp_customize->add_control('buzzstore_top_header_display_options', array( 'type' => 'radio', 'label' => __('Enable/Disable Top Header Section','buzzstore'), 'description' => __('Choose the option as you want', 'buzzstore'), 'section' => 'buzzstore_top_header_general_settings', 'choices' => array( 'yes' => __('Enable', 'buzzstore'), 'no' => __('Disable', 'buzzstore'), ) )); $wp_customize->add_setting('buzzstore_top_header_background_color', array( 'default' => '#333333', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_hex_color', )); $wp_customize->add_control('buzzstore_top_header_background_color', array( 'type' => 'color', 'label' => __('Top Header Background Colors','buzzstore'), 'description' => __('Select top header background color as you want', 'buzzstore'), 'section' => 'buzzstore_top_header_general_settings', )); /** * Top Header Left Side Settings Section */ $wp_customize->add_section('buzzstore_top_header_leftside_settings', array( 'title' => __('Top Header LeftSide Settings', 'buzzstore'), 'panel' => 'buzzstore_top_header_section', 'priority' => 2, )); $wp_customize->add_setting('buzzstore_header_leftside_options', array( 'default' => 'quickinfo', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'buzzstore_header_leftside_style_sanitize' // done )); $wp_customize->add_control('buzzstore_header_leftside_options', array( 'type' => 'radio', 'label' => __('Choose options as you want', 'buzzstore'), 'description' => __('Choose any one options as you want and enter related Information', 'buzzstore'), 'section' => 'buzzstore_top_header_leftside_settings', 'settings' => 'buzzstore_header_leftside_options', 'choices' => array( 'socialicon' => __('Social Icons','buzzstore'), 'topnavmenu' => __('Ton Nav Menu','buzzstore'), 'quickinfo' => __('Quick Information','buzzstore') ) )); /** * Active Callback function for quick information */ $wp_customize->add_setting('buzzstore_quick_map_address', array( 'default' => '232 Anytown, Main Street, CA 12345 USA', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'buzzstore_text_sanitize' //done )); $wp_customize->add_control('buzzstore_quick_map_address', array( 'type' => 'text', 'label' => __('Enter Map Address :', 'buzzstore'), 'section' => 'buzzstore_top_header_leftside_settings', 'settings' => 'buzzstore_quick_map_address', 'active_callback' => 'buzzstore_quickinfo_email_address' )); $wp_customize->add_setting('buzzstore_quick_email', array( 'default' => 'sparklewpthemes@gmail.com', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'buzzstore_text_sanitize' //done )); $wp_customize->add_control('buzzstore_quick_email', array( 'type' => 'text', 'label' => __('Enter Email Address :', 'buzzstore'), 'section' => 'buzzstore_top_header_leftside_settings', 'settings' => 'buzzstore_quick_email', 'active_callback' => 'buzzstore_quickinfo_email_address' )); $wp_customize->add_setting('buzzstore_quick_phone', array( 'default' => '+1 800 467 1980', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'buzzstore_text_sanitize' //done )); $wp_customize->add_control('buzzstore_quick_phone', array( 'type' => 'text', 'label' => __('Enter Phone Number :', 'buzzstore'), 'section' => 'buzzstore_top_header_leftside_settings', 'settings' => 'buzzstore_quick_phone', 'active_callback' => 'buzzstore_quickinfo_email_address' )); /** * Top Header Right Side Settings Section */ $wp_customize->add_section('buzzstore_top_header_rightside_settings', array( 'title' => __('Top Header RightSide Settings', 'buzzstore'), 'panel' => 'buzzstore_top_header_section', 'priority' => 3, )); $wp_customize->add_setting('buzzstore_display_wishlist', array( 'default' => 1, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'buzzstore_checkbox_sanitize' //done )); $wp_customize->add_control('buzzstore_display_wishlist', array( 'type' => 'checkbox', 'label' => __('Check to show the wishlist', 'buzzstore'), 'description' => __('Check to show the wishlist (Requires WooCommerce Wishlist Plugins)', 'buzzstore'), 'section' => 'buzzstore_top_header_rightside_settings', 'settings' => 'buzzstore_display_wishlist' )); $wp_customize->add_setting('buzzstore_display_myaccount_login', array( 'default' => 1, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'buzzstore_checkbox_sanitize' //done )); $wp_customize->add_control('buzzstore_display_myaccount_login', array( 'type' => 'checkbox', 'label' => __('Check to show the my account', 'buzzstore'), 'description' => __('Check to show the my account or login/register menu (Requires WooCommerce)', 'buzzstore'), 'section' => 'buzzstore_top_header_rightside_settings', 'settings' => 'buzzstore_display_myaccount_login' )); $wp_customize->get_section('header_image')->title = __( 'Main Header Settings', 'buzzstore' ); $wp_customize->get_section('header_image' )->priority = 6; $wp_customize->add_setting('buzzstore_search_options', array( 'default' => 1, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'buzzstore_checkbox_sanitize' //done )); $wp_customize->add_control('buzzstore_search_options', array( 'type' => 'checkbox', 'label' => __('Check to enable the Search', 'buzzstore'), 'section' => 'header_image', 'settings' => 'buzzstore_search_options' )); $wp_customize->add_setting('buzzstore_search_type', array( 'default' => 'no', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'buzzstore_radio_sanitize' // done )); $wp_customize->add_control('buzzstore_search_type', array( 'type' => 'radio', 'label' => __('Choose the option that you want', 'buzzstore'), 'section' => 'header_image', 'choices' => array( 'yes' => __('Normal Search', 'buzzstore'), 'no' => __('Advance Search With Category', 'buzzstore'), ) )); $wp_customize->add_setting('buzzstore_search_options_placeholder', array( 'default' => 'Product Search...', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'buzzstore_text_sanitize' //done )); $wp_customize->add_control('buzzstore_search_options_placeholder', array( 'type' => 'text', 'label' => __('Enter the search box Placeholder text', 'buzzstore'), 'section' => 'header_image', 'settings' => 'buzzstore_search_options_placeholder' )); /** * Banner/Slider Settings Panel */ $wp_customize->add_panel('buzzstore_slider_panel', array( 'title' => __( 'Home Slider Settings', 'buzzstore' ), 'priority' => 7 )); for ($i=1; $i < 4; $i++) { $wp_customize->add_section('buzzstore_slider'.$i, array( 'title' => __( 'Slider ', 'buzzstore' ).$i, 'panel' => 'buzzstore_slider_panel' )); $wp_customize->add_setting( 'buzzstore_slider_title'.$i, array( 'default' => __('Style & Comfort', 'buzzstore'), 'sanitize_callback' => 'buzzstore_text_sanitize' )); $wp_customize->add_control( 'buzzstore_slider_title'.$i, array( 'settings' => 'buzzstore_slider_title'.$i, 'section' => 'buzzstore_slider'.$i, 'type' => 'text', 'label' => __( 'Caption Title', 'buzzstore' ) )); $wp_customize->add_setting( 'buzzstore_slider_subtitle'.$i, array( 'default' => __('Lorem Ipsum is simply dummy text of the printing and typesetting industry, Lorem Ipsum has been the industry standard.', 'buzzstore'), 'sanitize_callback' => 'buzzstore_text_sanitize' )); $wp_customize->add_control( 'buzzstore_slider_subtitle'.$i, array( 'settings' => 'buzzstore_slider_subtitle'.$i, 'section' => 'buzzstore_slider'.$i, 'type' => 'textarea', 'label' => __( 'Caption SubTitle', 'buzzstore' ) )); $wp_customize->add_setting( 'buzzstore_slider_button_text'.$i, array( 'default' => __('Show Now', 'buzzstore'), 'sanitize_callback' => 'buzzstore_text_sanitize' )); $wp_customize->add_control( 'buzzstore_slider_button_text'.$i, array( 'settings' => 'buzzstore_slider_button_text'.$i, 'section' => 'buzzstore_slider'.$i, 'type' => 'text', 'label' => __( 'Button Title', 'buzzstore' ) )); $wp_customize->add_setting( 'buzzstore_slider_button_url'.$i, array( 'default' => esc_url( home_url( '/' ) ).'#focus', 'sanitize_callback' => 'esc_url_raw' )); $wp_customize->add_control( 'buzzstore_slider_button_url'.$i, array( 'settings' => 'buzzstore_slider_button_url'.$i, 'section' => 'buzzstore_slider'.$i, 'type' => 'url', 'label' => __( 'Button Link', 'buzzstore' ) )); $wp_customize->add_setting( 'buzzstore_slider_image'.$i, array( 'default' => get_template_directory_uri().'/assets/images/slider1.jpg', 'sanitize_callback' => 'esc_url_raw' )); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'buzzstore_slider_image'.$i, array( 'label' => __( 'Slider Image', 'buzzstore' ), 'settings' => 'buzzstore_slider_image'.$i, 'section' => 'buzzstore_slider'.$i, 'description' => __( 'Image Size: 1900X500px', 'buzzstore' ) ))); } /** * HomePage Icon Text Block Section */ $wp_customize->add_section('buzzstore_icon_block', array( 'priority' => 7, 'title' => __('Icon Text Block Settings', 'buzzstore'), )); $wp_customize->add_setting('buzzstore_icon_block_section', array( 'default' => 'enable', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'buzzstore_radio_enable_sanitize', // done )); $wp_customize->add_control('buzzstore_icon_block_section', array( 'type' => 'radio', 'label' => __('Enable/Disable Icon Text Block Section', 'buzzstore'), 'description' => __('Choose any options as you want','buzzstore'), 'section' => 'buzzstore_icon_block', 'setting' => 'buzzstore_icon_block_section', 'choices' => array( 'enable' => __('Enable', 'buzzstore'), 'disable' => __('Disable', 'buzzstore'), ))); $wp_customize->add_setting('buzzstore_icon_block_display_section', array( 'default' => 'below_slider', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'buzzstore_icon_block_display_sanitize', )); $wp_customize->add_control('buzzstore_icon_block_display_section', array( 'type' => 'radio', 'label' => __('Icon Block Display Position', 'buzzstore'), 'description' => __('Choose any options as you want','buzzstore'), 'section' => 'buzzstore_icon_block', 'setting' => 'buzzstore_icon_block_display_section', 'choices' => array( 'below_slider' => __('Below Main Slider', 'buzzstore'), 'above_footer' => __('Above the Footer', 'buzzstore'), ))); $wp_customize->add_setting('buzzstore_first_icon_block_area', array( 'default' => 'fa-user', 'sanitize_callback' => 'buzzstore_text_sanitize', // done 'transport' => 'postMessage' )); $wp_customize->add_control('buzzstore_first_icon_block_area',array( 'type' => 'text', 'description' => sprintf( __( 'Use font awesome icon: Eg: %s. %sSee more here%s', 'buzzstore' ), 'fa-user','','' ), 'label' => __('First Text Block Area Icon', 'buzzstore'), 'section' => 'buzzstore_icon_block', 'setting' => 'buzzstore_first_icon_block_area', )); $wp_customize->add_setting('buzzstore_first_title_icon_block_area', array( 'default' => '', 'sanitize_callback' => 'buzzstore_text_sanitize', // done 'transport' => 'postMessage' )); $wp_customize->add_control('buzzstore_first_title_icon_block_area',array( 'type' => 'text', 'label' => __('First Icon Block Title Text', 'buzzstore'), 'section' => 'buzzstore_icon_block', 'setting' => 'buzzstore_first_title_icon_block_area', )); $wp_customize->add_setting('buzzstore_second_icon_block_area', array( 'default' => 'fa-university', 'sanitize_callback' => 'buzzstore_text_sanitize', // done 'transport' => 'postMessage' )); $wp_customize->add_control('buzzstore_second_icon_block_area',array( 'type' => 'text', 'description' => sprintf( __( 'Use font awesome icon: Eg: %s. %sSee more here%s', 'buzzstore' ), 'fa-university','','' ), 'label' => __('Second Text Block Area Icon', 'buzzstore'), 'section' => 'buzzstore_icon_block', 'setting' => 'buzzstore_second_icon_block_area', )); $wp_customize->add_setting('buzzstore_second_title_icon_block_area', array( 'default' => '', 'sanitize_callback' => 'buzzstore_text_sanitize', // done 'transport' => 'postMessage' )); $wp_customize->add_control('buzzstore_second_title_icon_block_area',array( 'type' => 'text', 'label' => __('Second Icon Block Title Text', 'buzzstore'), 'section' => 'buzzstore_icon_block', 'setting' => 'buzzstore_second_title_icon_block_area', )); $wp_customize->add_setting('buzzstore_third_icon_block_area', array( 'default' => 'fa-futbol-o', 'sanitize_callback' => 'buzzstore_text_sanitize', // done 'transport' => 'postMessage' )); $wp_customize->add_control('buzzstore_third_icon_block_area',array( 'type' => 'text', 'description' => sprintf( __( 'Use font awesome icon: Eg: %s. %sSee more here%s', 'buzzstore' ), 'fa-futbol-o','','' ), 'label' => __('Thired Text Block Area Icon', 'buzzstore'), 'section' => 'buzzstore_icon_block', 'setting' => 'buzzstore_third_icon_block_area', )); $wp_customize->add_setting('buzzstore_thired_title_icon_block_area', array( 'default' => '', 'sanitize_callback' => 'buzzstore_text_sanitize', // done )); $wp_customize->add_control('buzzstore_thired_title_icon_block_area',array( 'type' => 'text', 'label' => __('Thired Icon Block Title Text', 'buzzstore'), 'section' => 'buzzstore_icon_block', 'setting' => 'buzzstore_thired_title_icon_block_area', )); /** * Breadcrumbs Settings */ $wp_customize->add_panel('buzzstore_breadcrumbs_settings', array( 'capability' => 'edit_theme_options', 'description'=> __('Manage breadcrumbs settings here as you want', 'buzzstore'), 'priority' => 8, 'title' => __('Breadcrumbs Settings', 'buzzstore') )); $wp_customize->add_section('buzzstore_woocommerce_breadcrumbs_settings', array( 'priority' => 2, 'title' => __('WooCommerce Breadcrumbs Settings', 'buzzstore'), 'panel' => 'buzzstore_breadcrumbs_settings' )); $wp_customize->add_setting('buzzstore_woocommerce_breadcrumbs_option', array( 'default' => 0, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'buzzstore_checkbox_sanitize' // done )); $wp_customize->add_control('buzzstore_woocommerce_breadcrumbs_option', array( 'type' => 'checkbox', 'label' => __('Check to Disable the Breadcrumbs Menu Only', 'buzzstore'), 'section' => 'buzzstore_woocommerce_breadcrumbs_settings', 'settings' => 'buzzstore_woocommerce_breadcrumbs_option' )); $wp_customize->add_setting('buzzstore_woocommerce_enable_disable_section', array( 'default' => 'enable', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'buzzstore_radio_enable_sanitize', // done )); $wp_customize->add_control('buzzstore_woocommerce_enable_disable_section', array( 'type' => 'radio', 'label' => __('Enable/Disable Breadcrumbs Section', 'buzzstore'), 'description' => __('Choose any options as you want','buzzstore'), 'section' => 'buzzstore_woocommerce_breadcrumbs_settings', 'setting' => 'buzzstore_woocommerce_enable_disable_section', 'choices' => array( 'enable' => __('Enable', 'buzzstore'), 'disable' => __('Disable', 'buzzstore'), ))); $wp_customize->add_setting('buzzstore_breadcrumbs_woocommerce_background_image', array( 'default' => '', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'esc_url_raw' )); $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'buzzstore_breadcrumbs_woocommerce_background_image', array( 'label' => __('Upload Breadcrumbs Background Image', 'buzzstore'), 'section' => 'buzzstore_woocommerce_breadcrumbs_settings', 'setting' => 'buzzstore_breadcrumbs_woocommerce_background_image' ))); $wp_customize->add_section('buzzstore_breadcrumbs_normal_page_section', array( 'priority' => 4, 'title' => __('Normal Page Settings', 'buzzstore'), 'panel' => 'buzzstore_breadcrumbs_settings' )); $wp_customize->add_setting('buzzstore_normal_page_breadcrumbs_option', array( 'default' => 0, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'buzzstore_checkbox_sanitize' // done )); $wp_customize->add_control('buzzstore_normal_page_breadcrumbs_option', array( 'type' => 'checkbox', 'label' => __('Check to Disable the Breadcrumbs Menu Only', 'buzzstore'), 'section' => 'buzzstore_breadcrumbs_normal_page_section', 'settings' => 'buzzstore_normal_page_breadcrumbs_option' )); $wp_customize->add_setting('buzzstore_normal_page_enable_disable_section', array( 'default' => 'enable', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'buzzstore_radio_enable_sanitize', // done )); $wp_customize->add_control('buzzstore_normal_page_enable_disable_section', array( 'type' => 'radio', 'label' => __('Enable or Disable Breadcrumbs Section', 'buzzstore'), 'description' => __('Choose any options as you want','buzzstore'), 'section' => 'buzzstore_breadcrumbs_normal_page_section', 'setting' => 'buzzstore_normal_page_enable_disable_section', 'choices' => array( 'enable' => __('Enable', 'buzzstore'), 'disable' => __('Disable', 'buzzstore'), ))); $wp_customize->add_setting('buzzstore_breadcrumbs_normal_page_background_image', array( 'default' => '', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'esc_url_raw' )); $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'buzzstore_breadcrumbs_normal_page_background_image', array( 'label' => __('Upload Breadcrumbs Background Image', 'buzzstore'), 'section' => 'buzzstore_breadcrumbs_normal_page_section', 'setting' => 'buzzstore_breadcrumbs_normal_page_background_image' ))); $wp_customize->add_section('buzzstore_breadcrumbs_post_archive_page_section', array( 'priority' => 5, 'title' => __('Posts/Archive Page Settings', 'buzzstore'), 'panel' => 'buzzstore_breadcrumbs_settings' )); $wp_customize->add_setting('buzzstore_post_archive_page_breadcrumbs_option', array( 'default' => 0, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'buzzstore_checkbox_sanitize' // done )); $wp_customize->add_control('buzzstore_post_archive_page_breadcrumbs_option', array( 'type' => 'checkbox', 'label' => __('Check to Disable the Breadcrumbs Menu Only', 'buzzstore'), 'section' => 'buzzstore_breadcrumbs_post_archive_page_section', 'settings' => 'buzzstore_post_archive_page_breadcrumbs_option' )); $wp_customize->add_setting('buzzstore_post_archive_page_enable_disable_section', array( 'default' => 'enable', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'buzzstore_radio_enable_sanitize', // done )); $wp_customize->add_control('buzzstore_post_archive_page_enable_disable_section', array( 'type' => 'radio', 'label' => __('Enable or Disable Breadcrumbs Section', 'buzzstore'), 'description' => __('Choose any options as you want','buzzstore'), 'section' => 'buzzstore_breadcrumbs_post_archive_page_section', 'setting' => 'buzzstore_post_archive_page_enable_disable_section', 'choices' => array( 'enable' => __('Enable', 'buzzstore'), 'disable' => __('Disable', 'buzzstore'), ))); $wp_customize->add_setting('buzzstore_breadcrumbs_post_archive_background_image', array( 'default' => '', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'esc_url_raw' )); $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'buzzstore_breadcrumbs_post_archive_background_image', array( 'label' => __('Upload Breadcrumbs Background Image', 'buzzstore'), 'section' => 'buzzstore_breadcrumbs_post_archive_page_section', 'setting' => 'buzzstore_breadcrumbs_post_archive_background_image' ))); /** * Start of the WooCommerce Design Options */ $wp_customize->add_panel('buzzstore_woocommerce_design_options', array( 'capabitity' => 'edit_theme_options', 'description' => __('Change the Design Settings and Options Settings of WooCommerce here as you want', 'buzzstore'), 'priority' => 9, 'title' => __('WooCommerce Settings', 'buzzstore') )); $wp_customize->add_section('buzzstore_woocommerce_category_page_settings', array( 'priority' => 1, 'title' => __('Category Pages Settings', 'buzzstore'), 'panel' => 'buzzstore_woocommerce_design_options' )); $wp_customize->add_setting('buzzstore_woocommerce_category_page_layout', array( 'default' => 'rightsidebar', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'buzzstore_layout_sanitize' //done )); $wp_customize->add_control(new BuzzStore_Image_Radio_Control($wp_customize, 'buzzstore_woocommerce_category_page_layout', array( 'type' => 'radio', 'label' => __('Select WooCommerce Category Layout', 'buzzstore'), 'section' => 'buzzstore_woocommerce_category_page_settings', 'settings' => 'buzzstore_woocommerce_category_page_layout', 'choices' => array( 'leftsidebar' => $buzz_imagepath.'left-sidebar.png', 'rightsidebar' => $buzz_imagepath.'right-sidebar.png', 'nosidebar' => $buzz_imagepath.'no-sidebar.png', ) ))); $wp_customize->add_setting('buzzstore_woocommerce_category_product_per_page', array( 'default' => 3, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'buzzstore_product_per_page_sanitize' //done )); $wp_customize->add_control('buzzstore_woocommerce_category_product_per_page', array( 'type' => 'select', 'label' => __('Display Number Row', 'buzzstore'), 'section' => 'buzzstore_woocommerce_category_page_settings', 'settings' => 'buzzstore_woocommerce_category_product_per_page', 'choices' => array( '2' => '2', '3' => '3', '4' => '4', ))); $wp_customize->add_setting('buzzstore_woocommerce_category_per_page_product_number', array( 'default' => 12, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'buzzstore_sanitize_number' // done )); $wp_customize->add_control('buzzstore_woocommerce_category_per_page_product_number', array( 'type' => 'number', 'label' => __('Enter Display Number Products Per Page', 'buzzstore'), 'section' => 'buzzstore_woocommerce_category_page_settings', 'settings' => 'buzzstore_woocommerce_category_per_page_product_number' )); /** * WooCommerce Product Single Page Settings */ $wp_customize->add_section('buzzstore_woocommerce_product_page_settings', array( 'priority' => 2, 'title' => __('Single Product Page Settings', 'buzzstore'), 'panel' => 'buzzstore_woocommerce_design_options' )); $wp_customize->add_setting('buzzstore_woocommerce_product_page_layout', array( 'default' => 'rightsidebar', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'buzzstore_layout_sanitize' //done )); $wp_customize->add_control(new BuzzStore_Image_Radio_Control($wp_customize, 'buzzstore_woocommerce_product_page_layout', array( 'type' => 'radio', 'label' => __('Select WooCommerce Single Layout', 'buzzstore'), 'section' => 'buzzstore_woocommerce_product_page_settings', 'settings' => 'buzzstore_woocommerce_product_page_layout', 'choices' => array( 'leftsidebar' => $buzz_imagepath.'left-sidebar.png', 'rightsidebar' => $buzz_imagepath.'right-sidebar.png', 'nosidebar' => $buzz_imagepath.'no-sidebar.png', ) ))); $wp_customize->add_setting('buzzstore_woocommerce_product_page_upsells_product_number', array( 'default' => 3, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'buzzstore_sanitize_number' // done )); $wp_customize->add_control('buzzstore_woocommerce_product_page_upsells_product_number', array( 'type' => 'number', 'label' => __('Enter Display Number of Upsells products', 'buzzstore'), 'section' => 'buzzstore_woocommerce_product_page_settings', 'settings' => 'buzzstore_woocommerce_product_page_upsells_product_number' )); $wp_customize->add_setting('buzzstore_woocommerce_product_page_related_product_number', array( 'default' => 3, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'buzzstore_sanitize_number' // done )); $wp_customize->add_control('buzzstore_woocommerce_product_page_related_product_number', array( 'type' => 'number', 'label' => __('Enter Display Number of related products', 'buzzstore'), 'section' => 'buzzstore_woocommerce_product_page_settings', 'settings' => 'buzzstore_woocommerce_product_page_related_product_number' )); /** * Start Footer Section here */ $wp_customize->add_panel('buzzstore_footer_settings', array( 'priority' => 115, 'title' => __('Footer Settings', 'buzzstore'), 'capability' => 'edit_theme_options', )); /** * Footer Area Two Settings */ $wp_customize->add_section('buzzstore_footer_area_two_settings', array( 'priority' => 2, 'title' => __('Footer Area Settings', 'buzzstore'), 'panel'=> 'buzzstore_footer_settings' )); $wp_customize->add_setting('buzzstore_footer_area_two_enable_disable_section', array( 'default' => 'enable', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'buzzstore_radio_enable_sanitize', // done )); $wp_customize->add_control('buzzstore_footer_area_two_enable_disable_section', array( 'type' => 'radio', 'label' => __('Enable or Disable Footer Area Two Section', 'buzzstore'), 'description' => __('Choose any options as you want','buzzstore'), 'section' => 'buzzstore_footer_area_two_settings', 'setting' => 'buzzstore_footer_area_two_enable_disable_section', 'choices' => array( 'enable' => __('Enable', 'buzzstore'), 'disable' => __('Disable', 'buzzstore'), ))); $wp_customize->add_setting('buzzstore_footer_area_two_background_color', array( 'default' => '#222222', 'priority' => 2, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_hex_color' )); $wp_customize->add_control('buzzstore_footer_area_two_background_color', array( 'type' => 'color', 'label' => __('Footer Area Two Background Colors','buzzstore'), 'description' => __('Select default footer area two background color as you want', 'buzzstore'), 'section' => 'buzzstore_footer_area_two_settings', )); /** * Footer Area One Settings */ $wp_customize->add_section('buzzstore_footer_buttom_area_settings', array( 'priority' => 3, 'title' => __('Sub Footer Area Settings', 'buzzstore'), 'panel'=> 'buzzstore_footer_settings' )); $wp_customize->add_setting('buzzstore_footer_buttom_area_background_color', array( 'default' => '#333333', 'priority' => 2, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_hex_color', )); $wp_customize->add_control('buzzstore_footer_buttom_area_background_color', array( 'type' => 'color', 'label' => __('Footer Buttom Area Background Colors','buzzstore'), 'description' => __('Select default footer buttom area background color as you want', 'buzzstore'), 'section' => 'buzzstore_footer_buttom_area_settings', )); $wp_customize->add_setting('buzzstore_footer_buttom_copyright_setting', array( 'default' => '', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'esc_textarea' //done )); $wp_customize->add_control('buzzstore_footer_buttom_copyright_setting', array( 'type' => 'textarea', 'label' => __('Footer Bottom Left Content (Copyright Text)', 'buzzstore'), 'section' => 'buzzstore_footer_buttom_area_settings', 'settings' => 'buzzstore_footer_buttom_copyright_setting' )); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'paymentlogo_image_one', array( 'section' => 'paymentlogo_images', 'label' => __('Upload Payment Logo Image', 'buzzstore'), 'type' => 'image', ))); $wp_customize->add_setting( 'paymentlogo_image_two', array( 'default' => '', 'sanitize_callback' => 'esc_url_raw' // done )); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'paymentlogo_image_two', array( 'section' => 'buzzstore_footer_buttom_area_settings', 'label' => __('Upload Payment Logo Image', 'buzzstore'), 'type' => 'image', ))); $wp_customize->add_setting( 'paymentlogo_image_three', array( 'default' => '', 'sanitize_callback' => 'esc_url_raw' // done )); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'paymentlogo_image_three', array( 'section' => 'buzzstore_footer_buttom_area_settings', 'label' => __('Upload Payment Logo Image', 'buzzstore'), 'type' => 'image', ))); $wp_customize->add_setting( 'paymentlogo_image_four', array( 'default' => '', 'sanitize_callback' => 'esc_url_raw' // done )); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'paymentlogo_image_four', array( 'section' => 'buzzstore_footer_buttom_area_settings', 'label' => __('Upload Payment Logo Image', 'buzzstore'), 'type' => 'image', ))); $wp_customize->add_setting( 'paymentlogo_image_five', array( 'default' => '', 'sanitize_callback' => 'esc_url_raw' // done )); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'paymentlogo_image_five', array( 'section' => 'buzzstore_footer_buttom_area_settings', 'label' => __('Upload Payment Logo Image', 'buzzstore'), 'type' => 'image', ))); $wp_customize->add_setting( 'paymentlogo_image_six', array( 'default' => '', 'sanitize_callback' => 'esc_url_raw' // done )); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'paymentlogo_image_six', array( 'section' => 'buzzstore_footer_buttom_area_settings', 'label' => __('Upload Payment Logo Image', 'buzzstore'), 'type' => 'image', ))); /** * Start of the Social Link Options */ $wp_customize->add_panel('buzzstore_social_links_options', array( 'priority' => 112, 'title' => __('Social Media settings', 'buzzstore'), 'description'=> __('Change the Social Links Settings from here as you want', 'buzzstore'), 'capability' => 'edit_theme_options', )); $wp_customize->add_section('buzzstore_social_link_activate_settings', array( 'priority' => 1, 'title' => __('Activate social links area', 'buzzstore'), 'panel' => 'buzzstore_social_links_options' )); $wp_customize->add_setting('buzzstore_social_link_activate', array( 'default' => 1, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'buzzstore_checkbox_sanitize' //done )); $wp_customize->add_control('buzzstore_social_link_activate', array( 'type' => 'checkbox', 'label' => __('Check to activate social links area', 'buzzstore'), 'section' => 'buzzstore_social_link_activate_settings', 'settings' => 'buzzstore_social_link_activate' )); $buzzstore_social_links = array( 'buzzstore_social_facebook' => array( 'id' => 'buzzstore_social_facebook', 'title' => __('Facebook', 'buzzstore'), 'default' => '' ), 'buzzstore_social_twitter' => array( 'id' => 'buzzstore_social_twitter', 'title' => __('Twitter', 'buzzstore'), 'default' => '' ), 'buzzstore_social_googleplus' => array( 'id' => 'buzzstore_social_googleplus', 'title' => __('Google-Plus', 'buzzstore'), 'default' => '' ), 'buzzstore_social_instagram' => array( 'id' => 'buzzstore_social_instagram', 'title' => __('Instagram', 'buzzstore'), 'default' => '' ), 'buzzstore_social_pinterest' => array( 'id' => 'buzzstore_social_pinterest', 'title' => __('Pinterest', 'buzzstore'), 'default' => '' ), 'buzzstore_social_youtube' => array( 'id' => 'buzzstore_social_youtube', 'title' => __('YouTube', 'buzzstore'), 'default' => '' ), ); $i = 20; foreach($buzzstore_social_links as $buzzstore_social_link) { $wp_customize->add_setting($buzzstore_social_link['id'], array( 'default' => $buzzstore_social_link['default'], 'capability' => 'edit_theme_options', 'sanitize_callback' => 'esc_url_raw' // done )); $wp_customize->add_control($buzzstore_social_link['id'], array( 'label' => $buzzstore_social_link['title'], 'section'=> 'buzzstore_social_link_activate_settings', 'settings'=> $buzzstore_social_link['id'], 'priority' => $i )); $wp_customize->add_setting($buzzstore_social_link['id'].'_checkbox', array( 'default' => 0, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'buzzstore_checkbox_sanitize' // done )); $wp_customize->add_control($buzzstore_social_link['id'].'_checkbox', array( 'type' => 'checkbox', 'label' => __('Check to show in new tab', 'buzzstore'), 'section'=> 'buzzstore_social_link_activate_settings', 'settings'=> $buzzstore_social_link['id'].'_checkbox', 'priority' => $i )); $i++; } /** * Web layout sanitization */ function buzzstore_web_layout_sanitize($input) { $valid_keys = array( 'boxed' => __('Boxed', 'buzzstore'), 'fullwidth' => __('Full Width', 'buzzstore') ); if ( array_key_exists( $input, $valid_keys ) ) { return $input; } else { return ''; } } /** * Text fields sanitization */ function buzzstore_text_sanitize( $input ) { return wp_kses_post( force_balance_tags( $input ) ); } /** * Number fields sanitization */ function buzzstore_sanitize_number( $input ) { $output = intval($input); return $output; } /** * Display Layout Sanitization */ function buzzstore_layout_sanitize($input) { $buzz_imagepath = get_template_directory_uri() . '/assets/images/'; $valid_keys = array( 'leftsidebar' => $buzz_imagepath.'left-sidebar.png', 'rightsidebar' => $buzz_imagepath.'right-sidebar.png', 'nosidebar' => $buzz_imagepath.'no-sidebar.png', ); if ( array_key_exists( $input, $valid_keys ) ) { return $input; } else { return ''; } } /** * Header Left Sidebar Options Sanitization */ function buzzstore_header_leftside_style_sanitize($input) { $valid_keys = array( 'socialicon' => __('Social Icons','buzzstore'), 'topnavmenu' => __('Ton Nav Menu','buzzstore'), 'quickinfo' => __('Quick Information','buzzstore') ); if ( array_key_exists( $input, $valid_keys ) ) { return $input; } else { return ''; } } /** * Product Display Column Sanitization */ function buzzstore_product_per_page_sanitize($input) { $valid_keys = array( '2' => '2', '3' => '3', '4' => '4', ); if ( array_key_exists( $input, $valid_keys ) ) { return $input; } else { return ''; } } /** * Display Related Products Sanitization */ function buzzstore_product_per_page_related_sanitize($input) { $valid_keys = array( '2' => '2', '3' => '3', '4' => '4', '5' => '5', ); if ( array_key_exists( $input, $valid_keys ) ) { return $input; } else { return ''; } } /** * Checkbox Sanitization */ function buzzstore_checkbox_sanitize($input) { if ( $input == 1 ) { return 1; } else { return 0; } } /** * Radio Button yes/no Sanitization */ function buzzstore_radio_sanitize($input) { $valid_keys = array( 'yes'=>__('Yes', 'buzzstore'), 'no'=>__('No', 'buzzstore') ); if ( array_key_exists( $input, $valid_keys ) ) { return $input; } else { return ''; } } /** * Single Product tab display style Sanitization */ function buzzstore_product_page_tab_sanitize($input) { $valid_keys = array( 'normaltabs' => 'Normal Tabs', 'verticaltabs' => 'Vertical Tabs', ); if ( array_key_exists( $input, $valid_keys ) ) { return $input; } else { return ''; } } /** * Display Related Product Style Types Sanitization */ function buzzstore_page_related_product_sanitize($input) { $valid_keys = array( 'none' => 'none', 'slider' => 'Slider', 'grid' => 'Grid' ); if ( array_key_exists( $input, $valid_keys ) ) { return $input; } else { return ''; } } /** * Enable/Disable Sanitization */ function buzzstore_radio_enable_sanitize($input) { $valid_keys = array( 'enable' => __('Enable', 'buzzstore'), 'disable' => __('Disable', 'buzzstore'), ); if ( array_key_exists( $input, $valid_keys ) ) { return $input; } else { return ''; } } /** * Icon Block Display Sanitization */ function buzzstore_icon_block_display_sanitize($input) { $valid_keys = array( 'below_slider' => __('Below Main Slider', 'buzzstore'), 'above_footer' => __('Above the Footer', 'buzzstore'), ); if ( array_key_exists( $input, $valid_keys ) ) { return $input; } else { return ''; } } /** * Top LeftSide Active CallBack Function Process */ if ( ! function_exists( 'buzzstore_quickinfo_email_address' ) ) { function buzzstore_quickinfo_email_address(){ if(esc_attr(get_theme_mod('buzzstore_header_leftside_options','quickinfo')) =='quickinfo'){ return true; }else{ return false; } } } if ( ! function_exists( 'buzzstore_social_icon_callback' ) ) { function buzzstore_social_icon_callback(){ if(esc_attr(get_theme_mod('buzzstore_header_leftside_options')) == 'socialicon'){ return true; }else{ return false; } } } } add_action( 'customize_register', 'buzzstore_customize_register' ); /** * Binds JS handlers to make Theme Customizer preview reload changes asynchronously. */ function buzzstore_customize_preview_js() { wp_enqueue_script( 'buzzstore_customizer', get_template_directory_uri() . '/assets/js/customizer.js', array( 'customize-preview' ), '20130508', true ); } add_action( 'customize_preview_init', 'buzzstore_customize_preview_js' );