get_setting( 'blogname' )->transport = 'postMessage'; $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage'; if ( isset( $wp_customize->selective_refresh ) ) { $wp_customize->selective_refresh->add_partial( 'blogname', array( 'selector' => '.site-title a', 'render_callback' => 'cab_booking_customize_partial_blogname', ) ); $wp_customize->selective_refresh->add_partial( 'blogdescription', array( 'selector' => '.site-description', 'render_callback' => 'cab_booking_customize_partial_blogdescription', ) ); } /* * Theme Options Panel */ $wp_customize->add_panel('cab_booking_panel', array( 'priority' => 25, 'capability' => 'edit_theme_options', 'title' => __('Cab Booking Theme Options', 'cab-booking'), )); /* * Customizer top header section */ $wp_customize->add_setting( 'cab_booking_site_title_text', array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => 1, 'sanitize_callback' => 'cab_booking_sanitize_checkbox', ) ); $wp_customize->add_control( 'cab_booking_site_title_text', array( 'label' => __('Enable Title', 'cab-booking'), 'description' => __('Enable or Disable Title from the site', 'cab-booking'), 'section' => 'title_tagline', 'type' => 'checkbox', ) ); $wp_customize->add_setting( 'cab_booking_site_tagline_text', array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => 0, 'sanitize_callback' => 'cab_booking_sanitize_checkbox', ) ); $wp_customize->add_control( 'cab_booking_site_tagline_text', array( 'label' => __('Enable Tagline', 'cab-booking'), 'description' => __('Enable or Disable Tagline from the site', 'cab-booking'), 'section' => 'title_tagline', 'type' => 'checkbox', ) ); $wp_customize->add_setting( 'cab_booking_logo_width', array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => '150', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'cab_booking_logo_width', array( 'label' => __('Logo Width in PX', 'cab-booking'), 'section' => 'title_tagline', 'type' => 'number', 'input_attrs' => array( 'min' => 100, 'max' => 300, 'step' => 1, ), ) ); /* WooCommerce custom settings */ $wp_customize->add_section('woocommerce_custom_settings', array( 'priority' => 5, 'capability' => 'edit_theme_options', 'theme_supports' => '', 'title' => __('WooCommerce Custom Settings', 'cab-booking'), 'panel' => 'woocommerce', )); $wp_customize->add_setting( 'cab_booking_per_columns', array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => '3', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'cab_booking_per_columns', array( 'label' => __('Product Per Single Row', 'cab-booking'), 'section' => 'woocommerce_custom_settings', 'type' => 'number', 'input_attrs' => array( 'min' => 1, 'max' => 4, 'step' => 1, ), ) ); $wp_customize->add_setting( 'cab_booking_product_per_page', array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => '6', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'cab_booking_product_per_page', array( 'label' => __('Product Per One Page', 'cab-booking'), 'section' => 'woocommerce_custom_settings', 'type' => 'number', 'input_attrs' => array( 'min' => 1, 'max' => 12, 'step' => 1, ), ) ); /*Related Products Enable Option*/ $wp_customize->add_setting( 'cab_booking_enable_related_product', array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => 1, 'sanitize_callback' => 'cab_booking_sanitize_checkbox', ) ); $wp_customize->add_control( 'cab_booking_enable_related_product', array( 'label' => __('Enable Related Product', 'cab-booking'), 'description' => __('Checked to show Related Product', 'cab-booking'), 'section' => 'woocommerce_custom_settings', 'type' => 'checkbox', ) ); $wp_customize->add_setting( 'custom_related_products_number', array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => '3', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'custom_related_products_number', array( 'label' => __('Related Product Count', 'cab-booking'), 'section' => 'woocommerce_custom_settings', 'type' => 'number', 'input_attrs' => array( 'min' => 1, 'max' => 20, 'step' => 1, ), ) ); $wp_customize->add_setting( 'custom_related_products_number_per_row', array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => '3', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'custom_related_products_number_per_row', array( 'label' => __('Related Product Per Row', 'cab-booking'), 'section' => 'woocommerce_custom_settings', 'type' => 'number', 'input_attrs' => array( 'min' => 1, 'max' => 4, 'step' => 1, ), ) ); /*Archive Product layout*/ $wp_customize->add_setting('cab_booking_archive_product_layout',array( 'default' => 'layout-1', 'sanitize_callback' => 'cab_booking_sanitize_choices' )); $wp_customize->add_control('cab_booking_archive_product_layout',array( 'type' => 'select', 'label' => esc_html__('Archive Product Layout','cab-booking'), 'section' => 'woocommerce_custom_settings', 'choices' => array( 'layout-1' => esc_html__('Sidebar On Right','cab-booking'), 'layout-2' => esc_html__('Sidebar On Left','cab-booking'), 'layout-3' => esc_html__('Full Width Layout','cab-booking') ), ) ); /*Single Product layout*/ $wp_customize->add_setting('cab_booking_single_product_layout',array( 'default' => 'layout-1', 'sanitize_callback' => 'cab_booking_sanitize_choices' )); $wp_customize->add_control('cab_booking_single_product_layout',array( 'type' => 'select', 'label' => esc_html__('Single Product Layout','cab-booking'), 'section' => 'woocommerce_custom_settings', 'choices' => array( 'layout-1' => esc_html__('Sidebar On Right','cab-booking'), 'layout-2' => esc_html__('Sidebar On Left','cab-booking'), 'layout-3' => esc_html__('Full Width Layout','cab-booking') ), ) ); $wp_customize->add_setting('cab_booking_woocommerce_product_sale',array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => 'Right', 'sanitize_callback' => 'cab_booking_sanitize_choices' )); $wp_customize->add_control('cab_booking_woocommerce_product_sale',array( 'label' => esc_html__( 'Woocommerce Product Sale Positions','cab-booking' ), 'type' => 'select', 'section' => 'woocommerce_custom_settings', 'choices' => array( 'Right' => __('Right','cab-booking'), 'Left' => __('Left','cab-booking'), 'Center' => __('Center','cab-booking') ), ) ); /*Additional Options*/ $wp_customize->add_section('cab_booking_additional_section', array( 'priority' => 5, 'capability' => 'edit_theme_options', 'theme_supports' => '', 'title' => __('Additional Options', 'cab-booking'), 'panel' => 'cab_booking_panel', )); /*Main Slider Enable Option*/ $wp_customize->add_setting( 'cab_booking_enable_sticky_header', array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => false, 'sanitize_callback' => 'cab_booking_sanitize_checkbox', ) ); $wp_customize->add_control( 'cab_booking_enable_sticky_header', array( 'label' => __('Enable Sticky Header', 'cab-booking'), 'description' => __('Checked to enable sticky header', 'cab-booking'), 'section' => 'cab_booking_additional_section', 'type' => 'checkbox', ) ); /*Main Slider Enable Option*/ $wp_customize->add_setting( 'cab_booking_enable_preloader', array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => 0, 'sanitize_callback' => 'cab_booking_sanitize_checkbox', ) ); $wp_customize->add_control( 'cab_booking_enable_preloader', array( 'label' => __('Enable Preloader', 'cab-booking'), 'description' => __('Checked to show preloader', 'cab-booking'), 'section' => 'cab_booking_additional_section', 'type' => 'checkbox', ) ); /*Breadcrumbs Enable Option*/ $wp_customize->add_setting( 'cab_booking_enable_breadcrumbs', array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => 1, 'sanitize_callback' => 'cab_booking_sanitize_checkbox', ) ); $wp_customize->add_control( 'cab_booking_enable_breadcrumbs', array( 'label' => __('Enable Breadcrumbs', 'cab-booking'), 'description' => __('Checked to show Breadcrumbs', 'cab-booking'), 'section' => 'cab_booking_additional_section', 'type' => 'checkbox', ) ); /*Post layout*/ $wp_customize->add_setting('cab_booking_archive_layout',array( 'default' => 'layout-1', 'sanitize_callback' => 'cab_booking_sanitize_choices' )); $wp_customize->add_control('cab_booking_archive_layout',array( 'type' => 'select', 'label' => esc_html__('Post Layout','cab-booking'), 'section' => 'cab_booking_additional_section', 'choices' => array( 'layout-1' => esc_html__('Sidebar On Right','cab-booking'), 'layout-2' => esc_html__('Sidebar On Left','cab-booking'), 'layout-3' => esc_html__('Full Width Layout','cab-booking') ), ) ); /*single post layout*/ $wp_customize->add_setting('cab_booking_post_layout',array( 'default' => 'layout-1', 'sanitize_callback' => 'cab_booking_sanitize_choices' )); $wp_customize->add_control('cab_booking_post_layout',array( 'type' => 'select', 'label' => esc_html__('Single Post Layout','cab-booking'), 'section' => 'cab_booking_additional_section', 'choices' => array( 'layout-1' => esc_html__('Sidebar On Right','cab-booking'), 'layout-2' => esc_html__('Sidebar On Left','cab-booking'), 'layout-3' => esc_html__('Full Width Layout','cab-booking') ), ) ); /*single page layout*/ $wp_customize->add_setting('cab_booking_page_layout',array( 'default' => 'layout-1', 'sanitize_callback' => 'cab_booking_sanitize_choices' )); $wp_customize->add_control('cab_booking_page_layout',array( 'type' => 'select', 'label' => esc_html__('Single Page Layout','cab-booking'), 'section' => 'cab_booking_additional_section', 'choices' => array( 'layout-1' => esc_html__('Sidebar On Right','cab-booking'), 'layout-2' => esc_html__('Sidebar On Left','cab-booking'), 'layout-3' => esc_html__('Full Width Layout','cab-booking') ), ) ); /*Archive Post Options*/ $wp_customize->add_section('cab_booking_blog_post_section', array( 'priority' => 5, 'capability' => 'edit_theme_options', 'theme_supports' => '', 'title' => __('Blog Page Options', 'cab-booking'), 'panel' => 'cab_booking_panel', )); $wp_customize->add_setting('cab_booking_enable_blog_post_title',array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => 1, 'sanitize_callback' => 'cab_booking_sanitize_checkbox', )); $wp_customize->add_control('cab_booking_enable_blog_post_title',array( 'label' => __('Enable Blog Post Title', 'cab-booking'), 'description' => __('Checked To Show Blog Post Title', 'cab-booking'), 'section' => 'cab_booking_blog_post_section', 'type' => 'checkbox', )); $wp_customize->add_setting('cab_booking_enable_blog_post_meta',array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => 1, 'sanitize_callback' => 'cab_booking_sanitize_checkbox', )); $wp_customize->add_control('cab_booking_enable_blog_post_meta',array( 'label' => __('Enable Blog Post Meta', 'cab-booking'), 'description' => __('Checked To Show Blog Post Meta Feilds', 'cab-booking'), 'section' => 'cab_booking_blog_post_section', 'type' => 'checkbox', )); $wp_customize->add_setting('cab_booking_enable_blog_post_tags',array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => 1, 'sanitize_callback' => 'cab_booking_sanitize_checkbox', )); $wp_customize->add_control('cab_booking_enable_blog_post_tags',array( 'label' => __('Enable Blog Post Tags', 'cab-booking'), 'description' => __('Checked To Show Blog Post Tags', 'cab-booking'), 'section' => 'cab_booking_blog_post_section', 'type' => 'checkbox', )); $wp_customize->add_setting('cab_booking_enable_blog_post_image',array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => 1, 'sanitize_callback' => 'cab_booking_sanitize_checkbox', )); $wp_customize->add_control('cab_booking_enable_blog_post_image',array( 'label' => __('Enable Blog Post Image', 'cab-booking'), 'description' => __('Checked To Show Blog Post Image', 'cab-booking'), 'section' => 'cab_booking_blog_post_section', 'type' => 'checkbox', )); $wp_customize->add_setting('cab_booking_enable_blog_post_content',array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => 1, 'sanitize_callback' => 'cab_booking_sanitize_checkbox', )); $wp_customize->add_control('cab_booking_enable_blog_post_content',array( 'label' => __('Enable Blog Post Content', 'cab-booking'), 'description' => __('Checked To Show Blog Post Content', 'cab-booking'), 'section' => 'cab_booking_blog_post_section', 'type' => 'checkbox', )); $wp_customize->add_setting('cab_booking_enable_blog_post_button',array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => 1, 'sanitize_callback' => 'cab_booking_sanitize_checkbox', )); $wp_customize->add_control('cab_booking_enable_blog_post_button',array( 'label' => __('Enable Blog Post Read More Button', 'cab-booking'), 'description' => __('Checked To Show Blog Post Read More Button', 'cab-booking'), 'section' => 'cab_booking_blog_post_section', 'type' => 'checkbox', )); /*Blog post Content layout*/ $wp_customize->add_setting('cab_booking_blog_Post_content_layout',array( 'default' => 'Left', 'sanitize_callback' => 'cab_booking_sanitize_choices' )); $wp_customize->add_control('cab_booking_blog_Post_content_layout',array( 'type' => 'select', 'label' => esc_html__('Blog Post Content Layout','cab-booking'), 'section' => 'cab_booking_blog_post_section', 'choices' => array( 'Left' => esc_html__('Left','cab-booking'), 'Center' => esc_html__('Center','cab-booking'), 'Right' => esc_html__('Right','cab-booking') ), ) ); /*Excerpt*/ $wp_customize->add_setting( 'cab_booking_excerpt_limit', array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => '25', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'cab_booking_excerpt_limit', array( 'label' => __('Excerpt Limit', 'cab-booking'), 'section' => 'cab_booking_blog_post_section', 'type' => 'number', 'input_attrs' => array( 'min' => 2, 'max' => 50, 'step' => 2, ), ) ); /*Archive Button Text*/ $wp_customize->add_setting( 'cab_booking_read_more_text', array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => 'Continue Reading....', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'cab_booking_read_more_text', array( 'label' => __('Edit Button Text ', 'cab-booking'), 'section' => 'cab_booking_blog_post_section', 'type' => 'text', ) ); /*Single Post Options*/ $wp_customize->add_section('cab_booking_single_post_section', array( 'priority' => 5, 'capability' => 'edit_theme_options', 'theme_supports' => '', 'title' => __('Single Post Options', 'cab-booking'), 'panel' => 'cab_booking_panel', )); $wp_customize->add_setting('cab_booking_enable_single_blog_post_title',array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => 1, 'sanitize_callback' => 'cab_booking_sanitize_checkbox', )); $wp_customize->add_control('cab_booking_enable_single_blog_post_title',array( 'label' => __('Enable Single Post Title', 'cab-booking'), 'description' => __('Checked To Show Single Blog Post Title', 'cab-booking'), 'section' => 'cab_booking_single_post_section', 'type' => 'checkbox', )); $wp_customize->add_setting('cab_booking_enable_single_blog_post_meta',array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => 1, 'sanitize_callback' => 'cab_booking_sanitize_checkbox', )); $wp_customize->add_control('cab_booking_enable_single_blog_post_meta',array( 'label' => __('Enable Single Post Meta', 'cab-booking'), 'description' => __('Checked To Show Single Blog Post Meta Feilds', 'cab-booking'), 'section' => 'cab_booking_single_post_section', 'type' => 'checkbox', )); $wp_customize->add_setting('cab_booking_enable_single_blog_post_tags',array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => 1, 'sanitize_callback' => 'cab_booking_sanitize_checkbox', )); $wp_customize->add_control('cab_booking_enable_single_blog_post_tags',array( 'label' => __('Enable Single Post Tags', 'cab-booking'), 'description' => __('Checked To Show Single Blog Post Tags', 'cab-booking'), 'section' => 'cab_booking_single_post_section', 'type' => 'checkbox', )); $wp_customize->add_setting('cab_booking_enable_single_post_image',array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => 1, 'sanitize_callback' => 'cab_booking_sanitize_checkbox', )); $wp_customize->add_control('cab_booking_enable_single_post_image',array( 'label' => __('Enable Single Post Image', 'cab-booking'), 'description' => __('Checked To Show Single Post Image', 'cab-booking'), 'section' => 'cab_booking_single_post_section', 'type' => 'checkbox', )); $wp_customize->add_setting('cab_booking_enable_single_blog_post_content',array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => 1, 'sanitize_callback' => 'cab_booking_sanitize_checkbox', )); $wp_customize->add_control('cab_booking_enable_single_blog_post_content',array( 'label' => __('Enable Single Post Content', 'cab-booking'), 'description' => __('Checked To Show Single Blog Post Content', 'cab-booking'), 'section' => 'cab_booking_single_post_section', 'type' => 'checkbox', )); /*Related Post Enable Option*/ $wp_customize->add_setting( 'cab_booking_enable_related_post', array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => 1, 'sanitize_callback' => 'cab_booking_sanitize_checkbox', ) ); $wp_customize->add_control( 'cab_booking_enable_related_post', array( 'label' => __('Enable Related Post', 'cab-booking'), 'description' => __('Checked to show Related Post', 'cab-booking'), 'section' => 'cab_booking_single_post_section', 'type' => 'checkbox', ) ); /*Related post Edit Text*/ $wp_customize->add_setting( 'cab_booking_related_post_text', array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => 'Related Post', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'cab_booking_related_post_text', array( 'label' => __('Edit Related Post Text ', 'cab-booking'), 'section' => 'cab_booking_single_post_section', 'type' => 'text', ) ); /*Related Post Per Page*/ $wp_customize->add_setting( 'cab_booking_related_post_count', array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => '3', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'cab_booking_related_post_count', array( 'label' => __('Related Post Count', 'cab-booking'), 'section' => 'cab_booking_single_post_section', 'type' => 'number', 'input_attrs' => array( 'min' => 1, 'max' => 9, 'step' => 1, ), ) ); /* * Customizer Global COlor */ /*Global Color Options*/ $wp_customize->add_section('cab_booking_global_color_section', array( 'priority' => 1, 'capability' => 'edit_theme_options', 'theme_supports' => '', 'title' => __('Global Color Options', 'cab-booking'), 'panel' => 'cab_booking_panel', )); $wp_customize->add_setting( 'cab_booking_primary_color', array( 'default' => '#EE3131', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'cab_booking_primary_color', array( 'label' => esc_html__( 'Primary Color', 'cab-booking' ), 'section' => 'cab_booking_global_color_section', 'settings' => 'cab_booking_primary_color', ) ) ); $wp_customize->add_setting( 'cab_booking_secondary_color', array( 'default' => '#2F3967', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'cab_booking_secondary_color', array( 'label' => esc_html__( 'Secondary Color', 'cab-booking' ), 'section' => 'cab_booking_global_color_section', 'settings' => 'cab_booking_secondary_color', ) ) ); /*Typography Options*/ $wp_customize->add_section( 'cab_booking_typography_section', array( 'panel' => 'cab_booking_panel', 'title' => __( 'Typography Options', 'cab-booking' ), 'priority' => 2, ) ); $wp_customize->add_setting( 'cab_booking_font_family', array( 'default' => 'default', 'sanitize_callback' => 'cab_booking_sanitize_font_family', ) ); $wp_customize->add_control( 'cab_booking_font_family', array( 'label' => __( 'Global Font Family', 'cab-booking' ), 'section' => 'cab_booking_typography_section', 'type' => 'select', 'choices' => array( 'default' => __( 'Default (Theme Font)', 'cab-booking' ), 'bad_script' => 'Bad Script', 'roboto' => 'Roboto', 'playfair_display' => 'Playfair Display', 'open_sans' => 'Open Sans', 'lobster' => 'Lobster', 'merriweather' => 'Merriweather', 'oswald' => 'Oswald', 'raleway' => 'Raleway', ), ) ); /* Header Options*/ $wp_customize->add_section('cab_booking_header_section', array( 'priority' => 5, 'capability' => 'edit_theme_options', 'theme_supports' => '', 'title' => __('Header Options', 'cab-booking'), 'panel' => 'cab_booking_panel', )); /*Phone Number*/ $wp_customize->add_setting( 'cab_booking_phone_number', array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => '900-300-600', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'cab_booking_phone_number', array( 'label' => __('Edit Phone Number', 'cab-booking'), 'section' => 'cab_booking_header_section', 'type' => 'text', ) ); $wp_customize->add_setting('cab_booking_header_phone_icon',array( 'default' => 'fas fa-phone-volume', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control(new Cab_Booking_Icon_Changer( $wp_customize,'cab_booking_header_phone_icon',array( 'label' => __('Phone Number Icon','cab-booking'), 'transport' => 'refresh', 'section' => 'cab_booking_header_section', 'type' => 'icon' ))); /* * Customizer main slider section */ /*Main Slider Options*/ $wp_customize->add_section('cab_booking_slider_section', array( 'priority' => 5, 'capability' => 'edit_theme_options', 'theme_supports' => '', 'title' => __('Main Slider Options', 'cab-booking'), 'panel' => 'cab_booking_panel', )); /*Main Slider Enable Option*/ $wp_customize->add_setting( 'cab_booking_enable_slider', array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => 0, 'sanitize_callback' => 'cab_booking_sanitize_checkbox', ) ); $wp_customize->add_control( 'cab_booking_enable_slider', array( 'label' => __('Enable Main Slider', 'cab-booking'), 'description' => __('Checked to show the main slider', 'cab-booking'), 'section' => 'cab_booking_slider_section', 'type' => 'checkbox', ) ); $wp_customize->add_setting( 'cab_booking_slide_number', array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'cab_booking_slide_number', array( 'label' => __('Number of slide to show', 'cab-booking'), 'section' => 'cab_booking_slider_section', 'type' => 'number', 'input_attrs' => array( 'min' => 1, 'max' => 3, ) ) ); $cab_booking_slide_count = (int)get_theme_mod('cab_booking_slide_number'); for ($cab_booking_m=1; $cab_booking_m <= $cab_booking_slide_count; $cab_booking_m++) { /*Main Slider Image*/ $wp_customize->add_setting( 'cab_booking_slider_image'.$cab_booking_m, array( 'capability' => 'edit_theme_options', 'default' => '', 'transport' => 'postMessage', 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'cab_booking_slider_image'.$cab_booking_m, array( 'label' => __('Edit Slider Image ', 'cab-booking') .$cab_booking_m, 'description' => __('Edit the slider image.', 'cab-booking'), 'section' => 'cab_booking_slider_section', ) ) ); /*Main Slider Heading*/ $wp_customize->add_setting( 'cab_booking_slider_heading'.$cab_booking_m, array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => '', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'cab_booking_slider_heading'.$cab_booking_m, array( 'label' => __('Edit Heading Text ', 'cab-booking') .$cab_booking_m, 'description' => __('Edit the slider heading text.', 'cab-booking'), 'section' => 'cab_booking_slider_section', 'type' => 'text', ) ); /*Main Slider Content*/ $wp_customize->add_setting( 'cab_booking_slider_text'.$cab_booking_m, array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => '', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'cab_booking_slider_text'.$cab_booking_m, array( 'label' => __('Edit Content Text ', 'cab-booking') .$cab_booking_m, 'description' => __('Edit the slider content text.', 'cab-booking'), 'section' => 'cab_booking_slider_section', 'type' => 'text', ) ); /*Main Slider Button1 Text*/ $wp_customize->add_setting( 'cab_booking_slider_button1_text'.$cab_booking_m, array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => '', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'cab_booking_slider_button1_text'.$cab_booking_m, array( 'label' => __('Edit Button #1 Text ', 'cab-booking') .$cab_booking_m, 'description' => __('Edit the slider button text.', 'cab-booking'), 'section' => 'cab_booking_slider_section', 'type' => 'text', ) ); /*Main Slider Button1 URL*/ $wp_customize->add_setting( 'cab_booking_slider_button1_link'.$cab_booking_m, array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => '', 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( 'cab_booking_slider_button1_link'.$cab_booking_m, array( 'label' => __('Edit Button #1 URL ', 'cab-booking') .$cab_booking_m, 'description' => __('Edit the slider button url.', 'cab-booking'), 'section' => 'cab_booking_slider_section', 'type' => 'url', ) ); } /* * Customizer Services section */ /*Services Options*/ $wp_customize->add_section('cab_booking_services_section', array( 'priority' => 5, 'capability' => 'edit_theme_options', 'theme_supports' => '', 'title' => __('Services Options', 'cab-booking'), 'panel' => 'cab_booking_panel', )); /*Main Services Enable Option*/ $wp_customize->add_setting( 'cab_booking_enable_service', array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => 1, 'sanitize_callback' => 'cab_booking_sanitize_checkbox', ) ); $wp_customize->add_control( 'cab_booking_enable_service', array( 'label' => __('Enable Services', 'cab-booking'), 'description' => __('Checked to show the services', 'cab-booking'), 'section' => 'cab_booking_services_section', 'type' => 'checkbox', ) ); $wp_customize->add_setting( 'cab_booking_services_number', array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'cab_booking_services_number', array( 'label' => __('Number of Services to show', 'cab-booking'), 'section' => 'cab_booking_services_section', 'type' => 'number', 'input_attrs' => array( 'min' => 1, 'max' => 3, ) ) ); $cab_booking_service_count = (int)get_theme_mod('cab_booking_services_number'); for ($cab_booking_m=1; $cab_booking_m <= $cab_booking_service_count; $cab_booking_m++) { /*Main Services Content*/ $wp_customize->add_setting( 'cab_booking_services_icon'.$cab_booking_m, array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => '', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'cab_booking_services_icon'.$cab_booking_m, array( 'label' => __('Edit Services Icon ', 'cab-booking') .$cab_booking_m, 'description' => __('Add Dashicon here.', 'cab-booking'), 'section' => 'cab_booking_services_section', 'type' => 'text', ) ); /*Main Services Heading*/ $wp_customize->add_setting( 'cab_booking_services_heading'.$cab_booking_m, array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => '', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'cab_booking_services_heading'.$cab_booking_m, array( 'label' => __('Edit Heading Text ', 'cab-booking') .$cab_booking_m, 'description' => __('Edit the service heading text.', 'cab-booking'), 'section' => 'cab_booking_services_section', 'type' => 'text', ) ); /*Main Services Content*/ $wp_customize->add_setting( 'cab_booking_services_text'.$cab_booking_m, array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => '', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'cab_booking_services_text'.$cab_booking_m, array( 'label' => __('Edit Content Text ', 'cab-booking') .$cab_booking_m, 'description' => __('Edit the service content text.', 'cab-booking'), 'section' => 'cab_booking_services_section', 'type' => 'text', ) ); } /* * Customizer Popular Car section */ /*Popular Car Options*/ $wp_customize->add_section('cab_booking_product_section', array( 'priority' => 5, 'capability' => 'edit_theme_options', 'theme_supports' => '', 'title' => __('Popular Car Options', 'cab-booking'), 'panel' => 'cab_booking_panel', )); /*Popular Car Enable Option*/ $wp_customize->add_setting( 'cab_booking_enable_project', array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => 0, 'sanitize_callback' => 'cab_booking_sanitize_checkbox', ) ); $wp_customize->add_control( 'cab_booking_enable_project', array( 'label' => __('Enable Popular Car Section', 'cab-booking'), 'description' => __('Checked to show the category', 'cab-booking'), 'section' => 'cab_booking_product_section', 'type' => 'checkbox', ) ); /*Main Services Heading*/ $wp_customize->add_setting( 'cab_booking_popular_car_heading', array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => '', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'cab_booking_popular_car_heading', array( 'label' => __('Edit Heading Text ', 'cab-booking') , 'description' => __('Edit the popular car heading text.', 'cab-booking'), 'section' => 'cab_booking_product_section', 'type' => 'text', ) ); $wp_customize->add_setting( 'cab_booking_popular_number', array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'cab_booking_popular_number', array( 'label' => __('Number of Popular Car to show', 'cab-booking'), 'section' => 'cab_booking_product_section', 'type' => 'number', 'input_attrs' => array( 'min' => 1, 'max' => 6, ) ) ); $cab_booking_popular_count = (int)get_theme_mod('cab_booking_popular_number'); for ($cab_booking_m=1; $cab_booking_m <= $cab_booking_popular_count; $cab_booking_m++) { /*Main Popular Image*/ $wp_customize->add_setting( 'cab_booking_popular_car_image'.$cab_booking_m, array( 'capability' => 'edit_theme_options', 'default' => '', 'transport' => 'postMessage', 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'cab_booking_popular_car_image'.$cab_booking_m, array( 'label' => __('Edit Popular Image ', 'cab-booking') .$cab_booking_m, 'description' => __('Edit the popular image.', 'cab-booking'), 'section' => 'cab_booking_product_section', ) ) ); /*Main Popular Car Price*/ $wp_customize->add_setting( 'cab_booking_popular_car_price'.$cab_booking_m, array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => '', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'cab_booking_popular_car_price'.$cab_booking_m, array( 'label' => __('Edit Popular Car Price ', 'cab-booking') .$cab_booking_m, 'description' => __('Edit the popular car price text.', 'cab-booking'), 'section' => 'cab_booking_product_section', 'type' => 'text', ) ); /*Main Popular Car Duration*/ $wp_customize->add_setting( 'cab_booking_popular_car_duration'.$cab_booking_m, array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => '', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'cab_booking_popular_car_duration'.$cab_booking_m, array( 'label' => __('Edit Car Duration ', 'cab-booking') .$cab_booking_m, 'description' => __('Edit the popular car duration.', 'cab-booking'), 'section' => 'cab_booking_product_section', 'type' => 'text', ) ); /*Main Popular Car Heading*/ $wp_customize->add_setting( 'cab_booking_popular_car_heading'.$cab_booking_m, array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => '', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'cab_booking_popular_car_heading'.$cab_booking_m, array( 'label' => __('Edit Popular Car Heading ', 'cab-booking') .$cab_booking_m, 'description' => __('Edit the popular car heading text.', 'cab-booking'), 'section' => 'cab_booking_product_section', 'type' => 'text', ) ); /*Main Popular Car Seats*/ $wp_customize->add_setting( 'cab_booking_popular_car_seats'.$cab_booking_m, array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => '', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'cab_booking_popular_car_seats'.$cab_booking_m, array( 'label' => __('Edit No Of Seats ', 'cab-booking') .$cab_booking_m, 'description' => __('Edit the popular car no of seats.', 'cab-booking'), 'section' => 'cab_booking_product_section', 'type' => 'text', ) ); /*Main Popular Car Types*/ $wp_customize->add_setting( 'cab_booking_popular_car_types'.$cab_booking_m, array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => '', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'cab_booking_popular_car_types'.$cab_booking_m, array( 'label' => __('Edit Transmission ', 'cab-booking') .$cab_booking_m, 'description' => __('Edit the popular car transmission .', 'cab-booking'), 'section' => 'cab_booking_product_section', 'type' => 'text', ) ); /*Main Popular Car Heading*/ $wp_customize->add_setting( 'cab_booking_popular_car_year'.$cab_booking_m, array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => '', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'cab_booking_popular_car_year'.$cab_booking_m, array( 'label' => __('Edit Popular Car Model Year ', 'cab-booking') .$cab_booking_m, 'description' => __('Edit the popular car model year.', 'cab-booking'), 'section' => 'cab_booking_product_section', 'type' => 'text', ) ); /*Main Popular Car Heading*/ $wp_customize->add_setting( 'cab_booking_services_mode'.$cab_booking_m, array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => '', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'cab_booking_services_mode'.$cab_booking_m, array( 'label' => __('Edit Air Condition ', 'cab-booking') .$cab_booking_m, 'description' => __('Edit the popular car air condition .', 'cab-booking'), 'section' => 'cab_booking_product_section', 'type' => 'text', ) ); /*Main Popular Car Heading*/ $wp_customize->add_setting( 'cab_booking_popular_car_button_text'.$cab_booking_m, array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => '', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'cab_booking_popular_car_button_text'.$cab_booking_m, array( 'label' => __('Edit Button Text ', 'cab-booking') .$cab_booking_m, 'description' => __('Edit the popular car button text.', 'cab-booking'), 'section' => 'cab_booking_product_section', 'type' => 'text', ) ); /*Main Slider Button1 URL*/ $wp_customize->add_setting( 'cab_booking_popular_car_button_link'.$cab_booking_m, array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => '', 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( 'cab_booking_popular_car_button_link'.$cab_booking_m, array( 'label' => __('Edit Button URL ', 'cab-booking') .$cab_booking_m, 'description' => __('Edit the Popular car button url.', 'cab-booking'), 'section' => 'cab_booking_product_section', 'type' => 'url', ) ); } /* * Customizer Footer Section */ /*Footer Options*/ $wp_customize->add_section('cab_booking_footer_section', array( 'priority' => 5, 'capability' => 'edit_theme_options', 'theme_supports' => '', 'title' => __('Footer Options', 'cab-booking'), 'panel' => 'cab_booking_panel', )); /*Footer Enable Option*/ $wp_customize->add_setting( 'cab_booking_enable_footer', array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => 1, 'sanitize_callback' => 'cab_booking_sanitize_checkbox', ) ); $wp_customize->add_control( 'cab_booking_enable_footer', array( 'label' => __('Enable Footer', 'cab-booking'), 'description' => __('Checked to show Footer', 'cab-booking'), 'section' => 'cab_booking_footer_section', 'type' => 'checkbox', ) ); /*Footer bg image Option*/ $wp_customize->add_setting('cab_booking_footer_bg_image',array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => '', 'sanitize_callback' => 'esc_url_raw', )); $wp_customize->add_control( new WP_Customize_Image_Control($wp_customize,'cab_booking_footer_bg_image',array( 'label' => __('Footer Background Image','cab-booking'), 'section' => 'cab_booking_footer_section', 'priority' => 1, ))); /*Footer Social Menu Option*/ $wp_customize->add_setting( 'cab_booking_footer_social_menu', array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => 1, 'sanitize_callback' => 'cab_booking_sanitize_checkbox', ) ); $wp_customize->add_control( 'cab_booking_footer_social_menu', array( 'label' => __('Enable Footer Social Menu', 'cab-booking'), 'description' => __('Checked to show the footer social menu. Go to Dashboard >> Appearance >> Menus >> Create New Menu >> Add Custom Link >> Add Social Menu >> Checked Social Menu >> Save Menu.', 'cab-booking'), 'section' => 'cab_booking_footer_section', 'type' => 'checkbox', ) ); /*Go To Top Option*/ $wp_customize->add_setting( 'cab_booking_enable_go_to_top_option', array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => 1, 'sanitize_callback' => 'cab_booking_sanitize_checkbox', ) ); $wp_customize->add_control( 'cab_booking_enable_go_to_top_option', array( 'label' => __('Enable Go To Top', 'cab-booking'), 'description' => __('Checked to enable Go To Top option.', 'cab-booking'), 'section' => 'cab_booking_footer_section', 'type' => 'checkbox', ) ); $wp_customize->add_setting('cab_booking_go_to_top_position',array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => 'Right', 'sanitize_callback' => 'cab_booking_sanitize_choices' )); $wp_customize->add_control('cab_booking_go_to_top_position',array( 'type' => 'select', 'section' => 'cab_booking_footer_section', 'label' => esc_html__('Go To Top Positions','cab-booking'), 'choices' => array( 'Right' => __('Right','cab-booking'), 'Left' => __('Left','cab-booking'), 'Center' => __('Center','cab-booking') ), ) ); /*Footer Copyright Text Enable*/ $wp_customize->add_setting( 'cab_booking_copyright_option', array( 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => '', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'cab_booking_copyright_option', array( 'label' => __('Edit Copyright Text', 'cab-booking'), 'description' => __('Edit the Footer Copyright Section.', 'cab-booking'), 'section' => 'cab_booking_footer_section', 'type' => 'text', ) ); } add_action( 'customize_register', 'cab_booking_customize_register' ); /** * Render the site title for the selective refresh partial. * * @return void */ function cab_booking_customize_partial_blogname() { bloginfo( 'name' ); } /** * Render the site tagline for the selective refresh partial. * * @return void */ function cab_booking_customize_partial_blogdescription() { bloginfo( 'description' ); } /** * Binds JS handlers to make Theme Customizer preview reload changes asynchronously. */ function cab_booking_customize_preview_js() { wp_enqueue_script( 'cab-booking-customizer', get_template_directory_uri() . '/js/customizer.js', array( 'customize-preview' ), CAB_BOOKING_VERSION, true ); } add_action( 'customize_preview_init', 'cab_booking_customize_preview_js' ); /** * Singleton class for handling the theme's customizer integration. * * @since 1.0.0 * @access public */ final class Cab_Booking_Customize { /** * Returns the instance. * * @since 1.0.0 * @access public * @return object */ public static function get_instance() { static $instance = null; if ( is_null( $instance ) ) { $instance = new self; $instance->setup_actions(); } return $instance; } /** * Constructor method. * * @since 1.0.0 * @access private * @return void */ private function __construct() {} /** * Sets up initial actions. * * @since 1.0.0 * @access private * @return void */ private function setup_actions() { // Register panels, sections, settings, controls, and partials. add_action( 'customize_register', array( $this, 'sections' ) ); // Register scripts and styles for the controls. add_action( 'customize_controls_enqueue_scripts', array( $this, 'enqueue_control_scripts' ), 0 ); } /** * Sets up the customizer sections. * * @since 1.0.0 * @access public * @param object $cab_booking_manager * @return void */ public function sections( $cab_booking_manager ) { // Load custom sections. load_template( trailingslashit( get_template_directory() ) . '/revolution/inc/section-pro.php' ); // Register custom section types. $cab_booking_manager->register_section_type( 'Cab_Booking_Customize_Section_Pro' ); // Register sections. $cab_booking_manager->add_section( new Cab_Booking_Customize_Section_Pro( $cab_booking_manager,'cab_booking_go_pro', array( 'priority' => 1, 'title' => esc_html__( 'Cab Booking Pro', 'cab-booking' ), 'pro_text' => esc_html__( 'Buy Pro', 'cab-booking' ), 'pro_url' => esc_url('https://www.revolutionwp.com/products/cab-booking-wordpress-theme'), ) ) ); // Register sections. $cab_booking_manager->add_section( new Cab_Booking_Customize_Section_Pro( $cab_booking_manager,'cab_booking_go_pro', array( 'priority' => 1, 'title' => esc_html__( 'Cab Booking Pro', 'cab-booking' ), 'pro_text' => esc_html__( 'Buy Pro', 'cab-booking' ), 'pro_url' => esc_url( CAB_BOOKING_BUY_NOW ), ) ) ); // Register sections. $cab_booking_manager->add_section( new Cab_Booking_Customize_Section_Pro( $cab_booking_manager,'cab_booking_lite_documentation', array( 'priority' => 1, 'title' => esc_html__( 'Lite Documentation', 'cab-booking' ), 'pro_text' => esc_html__( 'Instruction', 'cab-booking' ), 'pro_url' => esc_url( CAB_BOOKING_LITE_DOC ), ) ) ); $cab_booking_manager->add_section( new Cab_Booking_Customize_Section_Pro( $cab_booking_manager, 'cab_booking_live_demo', array( 'priority' => 1, 'title' => esc_html__( 'Pro Theme Demo', 'cab-booking' ), 'pro_text' => esc_html__( 'Live Preview', 'cab-booking' ), 'pro_url' => esc_url( CAB_BOOKING_LIVE_DEMO ), ) ) ); } /** * Loads theme customizer CSS. * * @since 1.0.0 * @access public * @return void */ public function enqueue_control_scripts() { wp_enqueue_script( 'cab-booking-customize-controls', trailingslashit( get_template_directory_uri() ) . '/revolution/assets/js/customize-controls.js', array( 'customize-controls' ) ); wp_enqueue_style( 'cab-booking-customize-controls', trailingslashit( get_template_directory_uri() ) . '/revolution/assets/css/customize-controls.css' ); } } // Doing this customizer thang! Cab_Booking_Customize::get_instance();