selective_refresh ) ? 'postMessage' : 'refresh'; /*========================================= Header Settings Panel =========================================*/ $wp_customize->add_panel( 'header_section', array( 'priority' => 2, 'capability' => 'edit_theme_options', 'title' => __('Header', 'architecture-designer'), ) ); /*========================================= Architecture Designer Site Identity =========================================*/ $wp_customize->add_section( 'title_tagline', array( 'priority' => 1, 'title' => __('Site Identity','architecture-designer'), 'panel' => 'header_section', ) ); // topheader Logo Width $topheaderlogowidth = esc_html__('100', 'architecture-designer' ); $wp_customize->add_setting( 'topheader_logowidth', array( 'default' => $topheaderlogowidth, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'wp_kses_post', 'priority' => 2, ) ); $wp_customize->add_control( 'topheader_logowidth', array( 'label' => __('Logo Width','architecture-designer'), 'section' => 'title_tagline', 'type' => 'range', 'transport' => $selective_refresh, ) ); // /*========================================= // Header Navigation // =========================================*/ // $wp_customize->add_section( // 'hdr_navigation', // array( // 'priority' => 3, // 'title' => __('Header Navigation','architecture-designer'), // 'panel' => 'header_section', // ) // ); // // Cart // $wp_customize->add_setting( // 'hdr_nav_cart' // ,array( // 'capability' => 'edit_theme_options', // 'sanitize_callback' => 'architecturedesigner_sanitize_text', // ) // ); // $wp_customize->add_control( // 'hdr_nav_cart', // array( // 'type' => 'hidden', // 'label' => __('Cart','architecture-designer'), // 'section' => 'hdr_navigation', // 'priority' => 2, // ) // ); // // hide/show // $wp_customize->add_setting( // 'hide_show_cart' , // array( // 'default' => '1', // 'capability' => 'edit_theme_options', // 'sanitize_callback' => 'architecturedesigner_sanitize_checkbox', // ) // ); // $wp_customize->add_control( // 'hide_show_cart', // array( // 'label' => esc_html__( 'Hide/Show', 'architecture-designer' ), // 'section' => 'hdr_navigation', // 'type' => 'checkbox', // 'priority' => 2, // ) // ); // // Header Search // $wp_customize->add_setting( // 'hdr_nav_search_head' // ,array( // 'capability' => 'edit_theme_options', // 'sanitize_callback' => 'architecturedesigner_sanitize_text', // ) // ); // $wp_customize->add_control( // 'hdr_nav_search_head', // array( // 'type' => 'hidden', // 'label' => __('Search','architecture-designer'), // 'section' => 'hdr_navigation', // 'priority' => 3, // ) // ); // // hide/show // $wp_customize->add_setting( // 'hs_nav_search' , // array( // 'default' => '1', // 'capability' => 'edit_theme_options', // 'sanitize_callback' => 'architecturedesigner_sanitize_checkbox', // ) // ); // $wp_customize->add_control( // 'hs_nav_search', // array( // 'label' => esc_html__( 'Hide/Show', 'architecture-designer' ), // 'section' => 'hdr_navigation', // 'type' => 'checkbox', // 'priority' => 3, // ) // ); // // Header Toggle // $wp_customize->add_setting( // 'hdr_nav_toggle_head' // ,array( // 'capability' => 'edit_theme_options', // 'sanitize_callback' => 'architecturedesigner_sanitize_text', // ) // ); // $wp_customize->add_control( // 'hdr_nav_toggle_head', // array( // 'type' => 'hidden', // 'label' => __('Toggle','architecture-designer'), // 'section' => 'hdr_navigation', // 'priority' => 6, // ) // ); // // hide/show // $wp_customize->add_setting( // 'hs_nav_toggle' , // array( // 'default' => '1', // 'capability' => 'edit_theme_options', // 'sanitize_callback' => 'architecturedesigner_sanitize_checkbox', // ) // ); // $wp_customize->add_control( // 'hs_nav_toggle', // array( // 'label' => esc_html__( 'Hide/Show', 'architecture-designer' ), // 'section' => 'hdr_navigation', // 'type' => 'checkbox', // 'priority' => 7, // ) // ); // // Title // // $wp_customize->add_setting( // 'architecturedesigner_hdr_toggle_ttl', // array( // 'sanitize_callback' => 'architecturedesigner_sanitize_html', // 'transport' => $selective_refresh, // 'capability' => 'edit_theme_options', // ) // ); // $wp_customize->add_control( // 'architecturedesigner_hdr_toggle_ttl', // array( // 'label' => __('Title','architecture-designer'), // 'section' => 'hdr_navigation', // 'type' => 'text', // 'priority' => 8, // ) // ); // // content // // $wp_customize->add_setting( // 'architecturedesigner_hdr_toggle_content', // array( // 'sanitize_callback' => 'architecturedesigner_sanitize_html', // 'transport' => $selective_refresh, // 'capability' => 'edit_theme_options', // ) // ); // $wp_customize->add_control( // 'architecturedesigner_hdr_toggle_content', // array( // 'label' => __('Title','architecture-designer'), // 'section' => 'hdr_navigation', // 'type' => 'textarea', // 'priority' => 8, // ) // ); /*========================================= Sticky Header =========================================*/ $wp_customize->add_section( 'sticky_header_set', array( 'priority' => 4, 'title' => __('Sticky Header','architecture-designer'), 'panel' => 'header_section', ) ); // Heading $wp_customize->add_setting( 'sticky_head' ,array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'architecturedesigner_sanitize_text', 'priority' => 1, ) ); $wp_customize->add_control( 'sticky_head', array( 'type' => 'hidden', 'label' => __('Sticky Header','architecture-designer'), 'section' => 'sticky_header_set', ) ); $wp_customize->add_setting( 'hide_show_sticky' , array( 'default' => '1', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'architecturedesigner_sanitize_checkbox', 'priority' => 2, ) ); $wp_customize->add_control( 'hide_show_sticky', array( 'label' => esc_html__( 'Hide/Show', 'architecture-designer' ), 'section' => 'sticky_header_set', 'type' => 'checkbox' ) ); // // topheader Button Color // $topheaderstickycolor = esc_html__('#074842', 'architecture-designer' ); // $wp_customize->add_setting( // 'topheader_stickycolor', // array( // 'default' => $topheaderstickycolor, // 'capability' => 'edit_theme_options', // 'sanitize_callback' => 'wp_kses_post', // 'priority' => 2, // ) // ); // $wp_customize->add_control( // 'topheader_stickycolor', // array( // 'label' => __('Header Color','architecture-designer'), // 'section' => 'sticky_header_set', // 'type' => 'color', // 'transport' => $selective_refresh, // ) // ); /*========================================= Architecture Designer header =========================================*/ $wp_customize->add_section( 'top_header', array( 'priority' => 5, 'title' => __('Header','architecture-designer'), 'panel' => 'header_section', ) ); $wp_customize->add_setting('architecturedesigner_top_header_tabs', array( 'sanitize_callback' => 'wp_kses_post', )); $wp_customize->add_control(new architecturedesigner_Tab_Control($wp_customize, 'architecturedesigner_top_header_tabs', array( 'section' => 'top_header', 'priority' => 1, 'buttons' => array( array( 'name' => esc_html__('General', 'architecture-designer'), 'fields' => array( 'topheader_emailicon', 'topheader_emailtext', 'topheader_mobicon', 'topheader_mobtext', 'header_icon1', 'header_icon1link', 'header_icon2', 'header_icon2link', 'header_icon3', 'header_icon3link', 'header_icon4', 'header_icon4link', 'header_icon5', 'header_icon5link', ), 'active' => true, ), array( 'name' => esc_html__('Style', 'architecture-designer'), 'fields' => array( 'topheader_iconcol', 'topheader_colortext', 'header_iconcol', 'header_bg_iconcol' ), ) ), ))); // topheader icon 1 $topheaderemailicon = esc_html__('fa fa-envelope-o', 'architecture-designer' ); $wp_customize->add_setting( 'topheader_emailicon', array( 'default' => $topheaderemailicon, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'wp_kses_post', 'priority' => 5, ) ); $wp_customize->add_control( 'topheader_emailicon', array( 'label' => __('Email Icon','architecture-designer'), 'section' => 'top_header', 'type' => 'icon', 'transport' => $selective_refresh, ) ); // topheader text 1 $topheaderemailtext = esc_html__('info@yourmail.com', 'architecture-designer' ); $wp_customize->add_setting( 'topheader_emailtext', array( 'default' => $topheaderemailtext, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'wp_kses_post', 'priority' => 6, ) ); $wp_customize->add_control( 'topheader_emailtext', array( 'label' => __('Email Text','architecture-designer'), 'section' => 'top_header', 'type' => 'text', 'transport' => $selective_refresh, ) ); // topheader icon 2 $topheadermobicon = esc_html__('fa fa-phone', 'architecture-designer' ); $wp_customize->add_setting( 'topheader_mobicon', array( 'default' => $topheadermobicon, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'wp_kses_post', 'priority' => 7, ) ); $wp_customize->add_control( 'topheader_mobicon', array( 'label' => __('Phone Icon','architecture-designer'), 'section' => 'top_header', 'type' => 'icon', 'transport' => $selective_refresh, ) ); // topheader text 2 $topheadermobtext = esc_html__('+91 800 9705 390', 'architecture-designer' ); $wp_customize->add_setting( 'topheader_mobtext', array( 'default' => $topheadermobtext, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'wp_kses_post', 'priority' => 8, ) ); $wp_customize->add_control( 'topheader_mobtext', array( 'label' => __('Phone Text','architecture-designer'), 'section' => 'top_header', 'type' => 'text', 'transport' => $selective_refresh, ) ); // header icon 1 $headericon1 = esc_html__('fa fa-facebook', 'architecture-designer' ); $wp_customize->add_setting( 'header_icon1', array( 'default' => $headericon1, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'wp_kses_post', 'priority' => 9, ) ); $wp_customize->add_control( 'header_icon1', array( 'label' => __('Header Icon 1','architecture-designer'), 'section' => 'top_header', 'type' => 'icon', 'transport' => $selective_refresh, ) ); // header icon 1 link $headericon1link = esc_html__('#', 'architecture-designer' ); $wp_customize->add_setting( 'header_icon1link', array( 'default' => $headericon1link, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'wp_kses_post', 'priority' => 10, ) ); $wp_customize->add_control( 'header_icon1link', array( 'label' => __('Header Icon 1 Link','architecture-designer'), 'section' => 'top_header', 'type' => 'text', 'transport' => $selective_refresh, ) ); // header icon 2 $headericon2 = esc_html__('fa fa-instagram', 'architecture-designer' ); $wp_customize->add_setting( 'header_icon2', array( 'default' => $headericon2, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'wp_kses_post', 'priority' => 11, ) ); $wp_customize->add_control( 'header_icon2', array( 'label' => __('Header Icon 2','architecture-designer'), 'section' => 'top_header', 'type' => 'icon', 'transport' => $selective_refresh, ) ); // header icon 2 link $headericon2link = esc_html__('#', 'architecture-designer' ); $wp_customize->add_setting( 'header_icon2link', array( 'default' => $headericon2link, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'wp_kses_post', 'priority' => 12, ) ); $wp_customize->add_control( 'header_icon2link', array( 'label' => __('Header Icon 2 Link','architecture-designer'), 'section' => 'top_header', 'type' => 'text', 'transport' => $selective_refresh, ) ); // header icon 3 $headericon3 = esc_html__('fa fa-twitter', 'architecture-designer' ); $wp_customize->add_setting( 'header_icon3', array( 'default' => $headericon3, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'wp_kses_post', 'priority' => 13, ) ); $wp_customize->add_control( 'header_icon3', array( 'label' => __('Header Icon 3','architecture-designer'), 'section' => 'top_header', 'type' => 'icon', 'transport' => $selective_refresh, ) ); // header icon 3 link $headericon3link = esc_html__('#', 'architecture-designer' ); $wp_customize->add_setting( 'header_icon3link', array( 'default' => $headericon3link, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'wp_kses_post', 'priority' => 14, ) ); $wp_customize->add_control( 'header_icon3link', array( 'label' => __('Header Icon 3 Link','architecture-designer'), 'section' => 'top_header', 'type' => 'text', 'transport' => $selective_refresh, ) ); // header icon 4 $headericon4 = esc_html__('fa fa-linkedin', 'architecture-designer' ); $wp_customize->add_setting( 'header_icon4', array( 'default' => $headericon4, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'wp_kses_post', 'priority' => 15, ) ); $wp_customize->add_control( 'header_icon4', array( 'label' => __('Header Icon 4','architecture-designer'), 'section' => 'top_header', 'type' => 'icon', 'transport' => $selective_refresh, ) ); // header icon 4 link $headericon4link = esc_html__('#', 'architecture-designer' ); $wp_customize->add_setting( 'header_icon4link', array( 'default' => $headericon4link, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'wp_kses_post', 'priority' => 16, ) ); $wp_customize->add_control( 'header_icon4link', array( 'label' => __('Header Icon 4 Link','architecture-designer'), 'section' => 'top_header', 'type' => 'text', 'transport' => $selective_refresh, ) ); // top header icon $topheadericoncol = esc_html__('#fdfdfd', 'architecture-designer' ); $wp_customize->add_setting( 'topheader_iconcol', array( 'default' => $topheadericoncol, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'wp_kses_post', 'priority' => 17, ) ); $wp_customize->add_control( 'topheader_iconcol', array( 'label' => __('Top Header Icon Color','architecture-designer'), 'section' => 'top_header', 'type' => 'color', 'transport' => $selective_refresh, ) ); // top header text $topheadercolortext = esc_html__('#9a9e9e', 'architecture-designer' ); $wp_customize->add_setting( 'topheader_colortext', array( 'default' => $topheadercolortext, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'wp_kses_post', 'priority' => 18, ) ); $wp_customize->add_control( 'topheader_colortext', array( 'label' => __('Top header Text Color','architecture-designer'), 'section' => 'top_header', 'type' => 'color', 'transport' => $selective_refresh, ) ); // header icon $headericoncol = esc_html__('#15403c', 'architecture-designer' ); $wp_customize->add_setting( 'header_iconcol', array( 'default' => $headericoncol, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'wp_kses_post', 'priority' => 19, ) ); $wp_customize->add_control( 'header_iconcol', array( 'label' => __('Icon Color','architecture-designer'), 'section' => 'top_header', 'type' => 'color', 'transport' => $selective_refresh, ) ); // header bg icon $headerbgiconcol = esc_html__('#fdfdfd', 'architecture-designer' ); $wp_customize->add_setting( 'header_bg_iconcol', array( 'default' => $headerbgiconcol, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'wp_kses_post', 'priority' => 20, ) ); $wp_customize->add_control( 'header_bg_iconcol', array( 'label' => __('Icon Background Color','architecture-designer'), 'section' => 'top_header', 'type' => 'color', 'transport' => $selective_refresh, ) ); $wp_customize->register_control_type('architecturedesigner_Tab_Control'); $wp_customize->register_panel_type( 'architecturedesigner_WP_Customize_Panel' ); $wp_customize->register_section_type( 'architecturedesigner_WP_Customize_Section' ); } add_action( 'customize_register', 'architecturedesigner_header_settings' ); if ( class_exists( 'WP_Customize_Panel' ) ) { class architecturedesigner_WP_Customize_Panel extends WP_Customize_Panel { public $panel; public $type = 'architecturedesigner_panel'; public function json() { $array = wp_array_slice_assoc( (array) $this, array( 'id', 'description', 'priority', 'type', 'panel', ) ); $array['title'] = html_entity_decode( $this->title, ENT_QUOTES, get_bloginfo( 'charset' ) ); $array['content'] = $this->get_content(); $array['active'] = $this->active(); $array['instanceNumber'] = $this->instance_number; return $array; } } } if ( class_exists( 'WP_Customize_Section' ) ) { class architecturedesigner_WP_Customize_Section extends WP_Customize_Section { public $section; public $type = 'architecturedesigner_section'; public function json() { $array = wp_array_slice_assoc( (array) $this, array( 'id', 'description', 'priority', 'panel', 'type', 'description_hidden', 'section', ) ); $array['title'] = html_entity_decode( $this->title, ENT_QUOTES, get_bloginfo( 'charset' ) ); $array['content'] = $this->get_content(); $array['active'] = $this->active(); $array['instanceNumber'] = $this->instance_number; if ( $this->panel ) { $array['customizeAction'] = sprintf( 'Customizing ▸ %s', esc_html( $this->manager->get_panel( $this->panel )->title ) ); } else { $array['customizeAction'] = 'Customizing'; } return $array; } } }