add_panel( 'general_settings', array(
'priority' => 125,
'capability' => 'edit_theme_options',
'title' => __('General Settings', 'business-a' ),
) );
/* Top Header */
$wp_customize->add_section( 'top_header' , array(
'title' => __('Top Header', 'business-a' ),
'panel' => 'general_settings'
) );
// header left icon1
$wp_customize->add_setting( 'business_option[header-left-icon1]' , array(
'default' => '',
'sanitize_callback' => 'sanitize_text_field',
'type'=>'option'
));
$wp_customize->add_control('business_option[header-left-icon1]' , array(
'label' => __('Top Header Icon 1','business-a' ),
'description'=> 'Add your icon like: fa-mobile click here! ',
'section' => 'top_header',
'type'=>'text',
) );
// header left text1
$wp_customize->add_setting( 'business_option[header-left-text1]' , array(
'default' => '',
'sanitize_callback' => 'sanitize_text_field',
'type'=>'option'
));
$wp_customize->add_control('business_option[header-left-text1]' , array(
'label' => __('Top Header Text 1','business-a' ),
'section' => 'top_header',
'type'=>'text',
) );
// header left icon2
$wp_customize->add_setting( 'business_option[header-left-icon2]' , array(
'default' => '',
'sanitize_callback' => 'sanitize_text_field',
'type'=>'option'
));
$wp_customize->add_control('business_option[header-left-icon2]' , array(
'label' => __('Top Header Icon 2','business-a' ),
'description'=> 'Add your icon like: fa-facebook click here!',
'section' => 'top_header',
'type'=>'text',
) );
// header left text2
$wp_customize->add_setting( 'business_option[header-left-text2]' , array(
'default' => '',
'sanitize_callback' => 'sanitize_text_field',
'type'=>'option'
));
$wp_customize->add_control('business_option[header-left-text2]' , array(
'label' => __('Top Header Text 2','business-a' ),
'section' => 'top_header',
'type'=>'text',
) );
// facebook url
$wp_customize->add_setting( 'business_option[header-facebook-url]' , array(
'default' => '',
'sanitize_callback' => 'sanitize_text_field',
'type'=>'option',
));
$wp_customize->add_control('business_option[header-facebook-url]' , array(
'label' => __('Header Facebook URL','business-a' ),
'section' => 'top_header',
'type'=>'text',
'input_attrs' => array(
'placeholder' => __('Facebook URL','business-a'),
),
) );
// twitter url
$wp_customize->add_setting( 'business_option[header-twitter-url]' , array(
'default' => '',
'sanitize_callback' => 'sanitize_text_field',
'type'=>'option'
));
$wp_customize->add_control('business_option[header-twitter-url]' , array(
'label' => __('Header Twitter URL','business-a' ),
'section' => 'top_header',
'type'=>'text',
'input_attrs' => array(
'placeholder' => __('Twitter URL','business-a'),
),
) );
// linkedin url
$wp_customize->add_setting( 'business_option[header-linkedin-url]' , array(
'default' => '',
'sanitize_callback' => 'sanitize_text_field',
'type'=>'option'
));
$wp_customize->add_control('business_option[header-linkedin-url]' , array(
'label' => __('Header Linked In URL','business-a' ),
'section' => 'top_header',
'type'=>'text',
'input_attrs' => array(
'placeholder' => __('Linked-In URL','business-a'),
),
) );
// googleplus url
$wp_customize->add_setting( 'business_option[header-googleplus-url]' , array(
'default' => '',
'sanitize_callback' => 'sanitize_text_field',
'type'=>'option'
));
$wp_customize->add_control('business_option[header-googleplus-url]' , array(
'label' => __('Header Google Plus URL','business-a' ),
'section' => 'top_header',
'type'=>'text',
'input_attrs' => array(
'placeholder' => __('Google+ URL','business-a'),
),
) );
// open window
$wp_customize->add_setting( 'business_option[header-social-target]' , array(
'default' => true,
'sanitize_callback' => 'business_a_sanitize_checkbox',
'type'=>'option'
));
$wp_customize->add_control('business_option[header-social-target]' , array(
'label' => __('Social icons open window in new tab','business-a' ),
'section' => 'top_header',
'type'=>'checkbox',
) );
// hide top header
$wp_customize->add_setting( 'business_option[top-header-hide]' , array(
'default' => false,
'sanitize_callback' => 'business_a_sanitize_checkbox',
'type'=>'option'
));
$wp_customize->add_control('business_option[top-header-hide]' , array(
'label' => __('Top header bar hide','business-a' ),
'section' => 'top_header',
'type'=>'checkbox',
) );
/* Boxed Layout */
$wp_customize->add_section( 'layout_section' , array(
'title' => __('Layout Settings', 'business-a' ),
'panel' => 'general_settings'
) );
// boxed layout settings
$wp_customize->add_setting( 'business_option[layout]' , array(
'default' => false,
'sanitize_callback' => 'business_a_sanitize_checkbox',
'type'=>'option'
));
$wp_customize->add_control('business_option[layout]' , array(
'label' => __('Boxed Layout','business-a' ),
'section' => 'layout_section',
'type'=>'checkbox',
) );
/* footer settings */
$wp_customize->add_section( 'footer_settings' , array(
'title' => __('Footer Settings', 'business-a' ),
'panel' => 'general_settings'
) );
// footer copyright
$wp_customize->add_setting( 'business_option[footer_copyright]' , array(
'default' => '',
'type'=>'option',
'sanitize_callback' => 'business_a_sanitize_text',
));
$wp_customize->add_control('business_option[footer_copyright]' , array(
'label' => __('Footer Copyright Text','business-a' ),
'section' => 'footer_settings',
'type'=>'text',
) );
// footer social icon enable / disable
$wp_customize->add_setting( 'business_option[footer_socialicon_enable]' , array(
'default' => true,
'sanitize_callback' => 'business_a_sanitize_checkbox',
'type'=>'option'
));
$wp_customize->add_control('business_option[footer_socialicon_enable]' , array(
'label' => __('Footer Social Icons Enable','business-a' ),
'section' => 'footer_settings',
'type'=>'checkbox',
) );
// footer social icon title
$wp_customize->add_setting( 'business_option[footer_socialicon_title]' , array(
'default' => '',
'type'=>'option',
'sanitize_callback' => 'business_a_sanitize_text',
));
$wp_customize->add_control('business_option[footer_socialicon_title]' , array(
'label' => __('Footer social icon title','business-a' ),
'section' => 'footer_settings',
'type'=>'text',
) );
// footer menus
$wp_customize->add_setting( 'business_option[footer_menu]' , array(
'default' => true,
'sanitize_callback' => 'business_a_sanitize_checkbox',
'type'=>'option'
));
$wp_customize->add_control('business_option[footer_menu]' , array(
'label' => __('Footer Menu Enable','business-a' ),
'section' => 'footer_settings',
'type'=>'checkbox',
) );
}
add_action( 'customize_register', 'business_a_genral_settings_fucntion' );
/*
* business sanitize text function
*/
function business_a_sanitize_text( $input ) {
return wp_kses_post( force_balance_tags( $input ) );
}
/*
* business sanitize checkbox function
*/
function business_a_sanitize_checkbox( $checked ) {
// Boolean check.
return ( ( isset( $checked ) && true == $checked ) ? true : false );
}