D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
self
/
root
/
proc
/
self
/
cwd
/
wp-content
/
themes
/
aeen
/
inc
/
customizer
/
settings
/
Filename :
header.php
back
Copy
<?php /** * @author RadiusTheme * @since 1.0 * @version 1.0 */ namespace radiustheme\aeen\Customizer\Settings; use radiustheme\aeen\Customizer\RDTheme_Customizer; use radiustheme\aeen\Customizer\Controls\Customizer_Switch_Control; use radiustheme\aeen\Customizer\Controls\Customizer_Image_Radio_Control; use WP_Customize_Color_Control; /** * Adds the individual sections, settings, and controls to the theme customizer */ class RDTheme_Header_Settings extends RDTheme_Customizer { public function __construct() { parent::instance(); $this->populated_default_data(); // Add Controls add_action( 'customize_register', array( $this, 'register_header_controls' ) ); } public function register_header_controls( $wp_customize ) { // Switch for Top Bar $wp_customize->add_setting( 'top_bar', array( 'default' => $this->defaults['top_bar'], 'transport' => 'refresh', 'sanitize_callback' => 'rttheme_switch_sanitization', ) ); $wp_customize->add_control( new Customizer_Switch_Control( $wp_customize, 'top_bar', array( 'label' => __( 'Top Bar', 'aeen' ), 'section' => 'header_section', ) ) ); // Phone Label Text $wp_customize->add_setting( 'phone_label', array( 'default' => $this->defaults['phone_label'], 'transport' => 'refresh', 'sanitize_callback' => 'rttheme_text_sanitization', 'active_callback' => 'rttheme_is_header_top_enabled', ) ); $wp_customize->add_control( 'phone_label', array( 'label' => __( 'Phone Label Text', 'aeen' ), 'section' => 'header_section', 'type' => 'text', 'active_callback' => 'rttheme_is_header_top_enabled', ) ); // Phone $wp_customize->add_setting( 'phone', array( 'default' => $this->defaults['phone'], 'transport' => 'refresh', 'sanitize_callback' => 'rttheme_text_sanitization', 'active_callback' => 'rttheme_is_header_top_enabled', ) ); $wp_customize->add_control( 'phone', array( 'label' => __( 'Phone', 'aeen' ), 'section' => 'header_section', 'type' => 'text', 'active_callback' => 'rttheme_is_header_top_enabled', ) ); // Email Label Text $wp_customize->add_setting( 'email_label', array( 'default' => $this->defaults['email_label'], 'transport' => 'refresh', 'sanitize_callback' => 'rttheme_text_sanitization', 'active_callback' => 'rttheme_is_header_top_enabled', ) ); $wp_customize->add_control( 'email_label', array( 'label' => __( 'Email Label Text', 'aeen' ), 'section' => 'header_section', 'type' => 'text', 'active_callback' => 'rttheme_is_header_top_enabled', ) ); // Email $wp_customize->add_setting( 'email', array( 'default' => $this->defaults['email'], 'transport' => 'refresh', 'sanitize_callback' => 'rttheme_text_sanitization', 'active_callback' => 'rttheme_is_header_top_enabled', ) ); $wp_customize->add_control( 'email', array( 'label' => __( 'Email', 'aeen' ), 'section' => 'header_section', 'type' => 'text', 'active_callback' => 'rttheme_is_header_top_enabled', ) ); // Address Label $wp_customize->add_setting( 'address_label', array( 'default' => $this->defaults['address_label'], 'transport' => 'refresh', 'sanitize_callback' => 'rttheme_text_sanitization', 'active_callback' => 'rttheme_is_header_top_enabled', ) ); $wp_customize->add_control( 'address_label', array( 'label' => __( 'Address Label', 'aeen' ), 'section' => 'header_section', 'type' => 'text', 'active_callback' => 'rttheme_is_header_top_enabled', ) ); // Address $wp_customize->add_setting( 'address', array( 'default' => $this->defaults['address'], 'transport' => 'refresh', 'sanitize_callback' => 'rttheme_text_sanitization', 'active_callback' => 'rttheme_is_header_top_enabled', ) ); $wp_customize->add_control( 'address', array( 'label' => __( 'Address', 'aeen' ), 'section' => 'header_section', 'type' => 'text', 'active_callback' => 'rttheme_is_header_top_enabled', ) ); // Header Style $wp_customize->add_setting( 'header_style', array( 'default' => $this->defaults['header_style'], 'transport' => 'refresh', 'sanitize_callback' => 'rttheme_radio_sanitization' ) ); $wp_customize->add_control( new Customizer_Image_Radio_Control( $wp_customize, 'header_style', array( 'label' => __( 'Header Layout', 'aeen' ), 'description' => esc_html__( 'You can override this settings only Mobile', 'aeen' ), 'section' => 'header_section', 'choices' => array( '1' => array( 'image' => trailingslashit( get_template_directory_uri() ) . 'assets/img/header-1.png', 'name' => __( 'Layout 1', 'aeen' ) ), '2' => array( 'image' => trailingslashit( get_template_directory_uri() ) . 'assets/img/header-2.png', 'name' => __( 'Layout 2', 'aeen' ) ), '3' => array( 'image' => trailingslashit( get_template_directory_uri() ) . 'assets/img/header-3.png', 'name' => __( 'Layout 3', 'aeen' ) ), ) ) ) ); // Switch for menu right part $wp_customize->add_setting( 'menu_right_part', array( 'default' => $this->defaults['menu_right_part'], 'transport' => 'refresh', 'sanitize_callback' => 'rttheme_switch_sanitization', ) ); $wp_customize->add_control( new Customizer_Switch_Control( $wp_customize, 'menu_right_part', array( 'label' => __( 'Right Part', 'aeen' ), 'section' => 'header_section', ) ) ); // Switch for menu search icon $wp_customize->add_setting( 'search_icon', array( 'default' => $this->defaults['search_icon'], 'transport' => 'refresh', 'sanitize_callback' => 'rttheme_switch_sanitization', 'active_callback' => 'rttheme_is_menu_right_part_enabled', ) ); $wp_customize->add_control( new Customizer_Switch_Control( $wp_customize, 'search_icon', array( 'label' => __( 'Search Icon', 'aeen' ), 'section' => 'header_section', 'active_callback' => 'rttheme_is_menu_right_part_enabled', ) ) ); // Switch for menu button $wp_customize->add_setting( 'menu_button', array( 'default' => $this->defaults['menu_button'], 'transport' => 'refresh', 'sanitize_callback' => 'rttheme_switch_sanitization', 'active_callback' => 'rttheme_is_menu_right_part_enabled', ) ); $wp_customize->add_control( new Customizer_Switch_Control( $wp_customize, 'menu_button', array( 'label' => __( 'Menu Button', 'aeen' ), 'section' => 'header_section', 'active_callback' => 'rttheme_is_menu_right_part_enabled', ) ) ); // Menu Button Label Text $wp_customize->add_setting( 'menu_btn_label', array( 'default' => $this->defaults['menu_btn_label'], 'transport' => 'refresh', 'sanitize_callback' => 'rttheme_text_sanitization', 'active_callback' => 'rttheme_is_menu_right_part_enabled', ) ); $wp_customize->add_control( 'menu_btn_label', array( 'label' => __( 'Button Label', 'aeen' ), 'section' => 'header_section', 'type' => 'text', 'active_callback' => 'rttheme_is_menu_right_part_enabled', ) ); // Menu Button Link $wp_customize->add_setting( 'menu_btn_link', array( 'default' => $this->defaults['menu_btn_link'], 'transport' => 'refresh', 'sanitize_callback' => 'rttheme_text_sanitization', 'active_callback' => 'rttheme_is_menu_right_part_enabled', ) ); $wp_customize->add_control( 'menu_btn_link', array( 'label' => __( 'Button Link', 'aeen' ), 'section' => 'header_section', 'type' => 'text', 'active_callback' => 'rttheme_is_menu_right_part_enabled', ) ); // Menu Phone $wp_customize->add_setting( 'menu_phone', array( 'default' => $this->defaults['menu_phone'], 'transport' => 'refresh', 'sanitize_callback' => 'rttheme_text_sanitization', 'active_callback' => 'rttheme_is_menu_right_part_enabled', ) ); $wp_customize->add_control( 'menu_phone', array( 'label' => __( 'Phone', 'aeen' ), 'section' => 'header_section', 'type' => 'text', 'active_callback' => 'rttheme_is_menu_right_part_enabled', ) ); } } /** * Initialise our Customizer settings only when they're required */ if ( class_exists( 'WP_Customize_Control' ) ) { new RDTheme_Header_Settings(); }