sweedy/inc/customize/specia-header-section.php

115 lines
No EOL
2.7 KiB
PHP

<?php
function fabify_header_setting( $wp_customize ) {
/*=========================================
Header Settings Panel
=========================================*/
$wp_customize->add_panel(
'header_section',
array(
'priority' => 127,
'capability' => 'edit_theme_options',
'title' => __('Header Section', 'fabify'),
)
);
/*=========================================
Header Cart & Button
=========================================*/
$wp_customize->add_section(
'cart_button',
array(
'priority' => 4,
'title' => __('Header Cart & Button','fabify'),
'description' =>'',
'panel' => 'header_section',
)
);
$wp_customize->add_setting(
'header_cart' ,
array(
'default' => 'on',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'specia_sanitize_select',
)
);
$wp_customize->add_control(
'header_cart' ,
array(
'label' => __( 'Hide/ Show Header Cart', 'fabify' ),
'section' => 'cart_button',
'settings' => 'header_cart',
'type' => 'radio',
'choices' =>
array(
'on' => 'Show',
'off' => 'Hide'
)
)
);
$wp_customize->add_setting(
'button_icon',
array(
'default' => 'fa-clock-o',
'sanitize_callback' => 'sanitize_text_field',
'capability' => 'edit_theme_options',
)
);
$wp_customize->add_control(
'button_icon',
array(
'label' => __('Button Icon','fabify'),
'section' => 'cart_button',
'settings'=> 'button_icon',
'type' => 'text',
'description' => sprintf(__( "Want to get more icons <a href='https://fontawesome.com/v4.7.0/icons/' target='_blank'>Click Here</a>", "fabify" )),
)
);
$wp_customize->add_setting(
'button_label',
array(
'default' => __( 'Book Now', 'fabify' ),
'sanitize_callback' => 'sanitize_text_field',
'capability' => 'edit_theme_options',
)
);
$wp_customize->add_control(
'button_label',
array(
'label' => __('Button Label','fabify'),
'section' => 'cart_button',
'settings'=> 'button_label',
'type' => 'text'
)
);
$wp_customize->add_setting(
'button_url',
array(
'default' => '',
'sanitize_callback' => 'specia_sanitize_url',
'capability' => 'edit_theme_options',
)
);
$wp_customize->add_control(
'button_url',
array(
'label' => __('Button URL','fabify'),
'section' => 'cart_button',
'settings'=> 'button_url',
'type' => 'text'
)
);
}
add_action( 'customize_register', 'fabify_header_setting' );
?>