b0y-101 Mini Shell


Current Path : E:/www2/tcas/wp-content/themes/businesszen/inc/customizer/sections/
File Upload :
Current File : E:/www2/tcas/wp-content/themes/businesszen/inc/customizer/sections/top-bar.php

<?php
/**
 * Topbar Section options
 *
 * @package Theme Palace
 * @subpackage Businesszen
 * @since Businesszen 1.0.0
 */

// Add Topbar section
$wp_customize->add_section( 'businesszen_topbar_section', array(
	'title'             => esc_html__( 'Topbar','businesszen' ),
	'description'       => esc_html__( 'Topbar Section options.', 'businesszen' ),
	'panel'             => 'businesszen_front_page_panel',
) );

// Topbar content enable control and setting
$wp_customize->add_setting( 'businesszen_theme_options[topbar_section_enable]', array(
    'default'           =>  $options['topbar_section_enable'],
    'sanitize_callback' => 'businesszen_sanitize_switch_control',
) );

$wp_customize->add_control( new Businesszen_Switch_Control( $wp_customize, 'businesszen_theme_options[topbar_section_enable]', array(
    'label'             => esc_html__( 'Topbar Section Enable', 'businesszen' ),
    'section'           => 'businesszen_topbar_section',
    'on_off_label'      => businesszen_switch_options(),
) ) );

// Social menu enable control and setting
$wp_customize->add_setting( 'businesszen_theme_options[topbar_social_menu_enable]', array(
    'default'           =>  $options['topbar_social_menu_enable'],
    'sanitize_callback' => 'businesszen_sanitize_switch_control',
) );

$wp_customize->add_control( new Businesszen_Switch_Control( $wp_customize, 'businesszen_theme_options[topbar_social_menu_enable]', array(
    'label'             => esc_html__( 'Enable Social menu', 'businesszen' ),
    'description'       => sprintf( '%1$s <a class="topbar-menu-trigger" href="#"> %2$s </a> %3$s', esc_html__( 'Note: To show social menu.', 'businesszen' ), esc_html__( 'Click Here', 'businesszen' ), esc_html__( 'to create menu', 'businesszen' ) ),
    'active_callback'   => 'businesszen_is_topbar_section_enable',
    'section'           => 'businesszen_topbar_section',
    'on_off_label'      => businesszen_switch_options(),
) ) );

// team sub_title setting and control
$wp_customize->add_setting( 'businesszen_theme_options[topbar_no]', array(
    'sanitize_callback' => 'sanitize_text_field',
    'default'           => $options['topbar_no'],
    'transport'         => 'postMessage',
) );

$wp_customize->add_control( 'businesszen_theme_options[topbar_no]', array(
    'label'             => esc_html__( 'Contact Number', 'businesszen' ),
    'section'           => 'businesszen_topbar_section',
    'active_callback'   => 'businesszen_is_topbar_section_enable',
    'type'              => 'text',
) );

// Abort if selective refresh is not available.
if ( isset( $wp_customize->selective_refresh ) ) {
    $wp_customize->selective_refresh->add_partial( 'businesszen_theme_options[topbar_no]', array(
        'selector'            => '#top-bar li.number',
        'settings'            => 'businesszen_theme_options[topbar_no]',
        'container_inclusive' => false,
        'fallback_refresh'    => true,
        'render_callback'     => 'businesszen_topbar_no_partial',
    ) );
}

// team sub_title setting and control
$wp_customize->add_setting( 'businesszen_theme_options[topbar_email]', array(
    'sanitize_callback' => 'sanitize_text_field',
    'default'           => $options['topbar_email'],
    'transport'         => 'postMessage',
) );

$wp_customize->add_control( 'businesszen_theme_options[topbar_email]', array(
    'label'             => esc_html__( 'Email Address', 'businesszen' ),
    'section'           => 'businesszen_topbar_section',
    'active_callback'   => 'businesszen_is_topbar_section_enable',
    'type'              => 'text',
) );

// Abort if selective refresh is not available.
if ( isset( $wp_customize->selective_refresh ) ) {
    $wp_customize->selective_refresh->add_partial( 'businesszen_theme_options[topbar_email]', array(
        'selector'            => '#top-bar li.email',
        'settings'            => 'businesszen_theme_options[topbar_email]',
        'container_inclusive' => false,
        'fallback_refresh'    => true,
        'render_callback'     => 'businesszen_topbar_email_partial',
    ) );
}

// team sub_title setting and control
$wp_customize->add_setting( 'businesszen_theme_options[topbar_location]', array(
    'sanitize_callback' => 'sanitize_text_field',
    'default'           => $options['topbar_location'],
    'transport'         => 'postMessage',
) );

$wp_customize->add_control( 'businesszen_theme_options[topbar_location]', array(
    'label'             => esc_html__( 'Address / Location', 'businesszen' ),
    'section'           => 'businesszen_topbar_section',
    'active_callback'   => 'businesszen_is_topbar_section_enable',
    'type'              => 'text',
) );

// Abort if selective refresh is not available.
if ( isset( $wp_customize->selective_refresh ) ) {
    $wp_customize->selective_refresh->add_partial( 'businesszen_theme_options[topbar_location]', array(
        'selector'            => '#top-bar li.location',
        'settings'            => 'businesszen_theme_options[topbar_location]',
        'container_inclusive' => false,
        'fallback_refresh'    => true,
        'render_callback'     => 'businesszen_topbar_location_partial',
    ) );
}

Copyright © 2019 by b0y-101