D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
self
/
root
/
proc
/
thread-self
/
cwd
/
wp-content
/
themes
/
aeen
/
inc
/
customizer
/
settings
/
Filename :
general.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_Heading_Control; use radiustheme\aeen\Customizer\Controls\Customizer_Switch_Control; use radiustheme\aeen\Customizer\Controls\Customizer_Separator_Control; use WP_Customize_Media_Control; use WP_Customize_Color_Control; /** * Adds the individual sections, settings, and controls to the theme customizer */ class RDTheme_General_Settings extends RDTheme_Customizer { public function __construct() { parent::instance(); $this->populated_default_data(); // Add Controls add_action( 'customize_register', array( $this, 'register_general_controls' ) ); } public function register_general_controls( $wp_customize ) { $wp_customize->add_setting( 'logo', array( 'default' => $this->defaults['logo'], 'transport' => 'refresh', 'sanitize_callback' => 'absint', ) ); $wp_customize->add_control( new WP_Customize_Media_Control( $wp_customize, 'logo', array( 'label' => __( 'Main Logo', 'aeen' ), 'description' => esc_html__( 'This is the description for the Media Control', 'aeen' ), 'section' => 'general_section', 'mime_type' => 'image', 'button_labels' => array( 'select' => __( 'Select File', 'aeen' ), 'change' => __( 'Change File', 'aeen' ), 'default' => __( 'Default', 'aeen' ), 'remove' => __( 'Remove', 'aeen' ), 'placeholder' => __( 'No file selected', 'aeen' ), 'frame_title' => __( 'Select File', 'aeen' ), 'frame_button' => __( 'Choose File', 'aeen' ), ) ) ) ); $wp_customize->add_setting( 'logo_dark', array( 'default' => $this->defaults['logo_dark'], 'transport' => 'refresh', 'sanitize_callback' => 'absint', ) ); $wp_customize->add_control( new WP_Customize_Media_Control( $wp_customize, 'logo_dark', array( 'label' => __( 'Logo Dark', 'aeen' ), 'description' => esc_html__( 'This is the description for the Media Control', 'aeen' ), 'section' => 'general_section', 'mime_type' => 'image', 'button_labels' => array( 'select' => __( 'Select File', 'aeen' ), 'change' => __( 'Change File', 'aeen' ), 'default' => __( 'Default', 'aeen' ), 'remove' => __( 'Remove', 'aeen' ), 'placeholder' => __( 'No file selected', 'aeen' ), 'frame_title' => __( 'Select File', 'aeen' ), 'frame_button' => __( 'Choose File', 'aeen' ), ) ) ) ); $wp_customize->add_setting( 'logo_width', array( 'default' => $this->defaults['logo_width'], 'transport' => 'refresh', 'sanitize_callback' => 'rttheme_text_sanitization', ) ); $wp_customize->add_control( 'logo_width', array( 'label' => __( 'Logo Width', 'aeen' ), 'section' => 'general_section', 'description' => esc_html__( 'Default logo size 130x45px ( Input logo size only number widthout px )', 'aeen' ), 'type' => 'number', ) ); $wp_customize->add_setting( 'mobile_logo_width', array( 'default' => $this->defaults['mobile_logo_width'], 'transport' => 'refresh', 'sanitize_callback' => 'rttheme_text_sanitization', ) ); $wp_customize->add_control( 'mobile_logo_width', array( 'label' => __( 'Mobile Logo Width', 'aeen' ), 'section' => 'general_section', 'description' => esc_html__( 'Default logo size 130x45px ( Input logo size only number widthout px )', 'aeen' ), 'type' => 'number', ) ); /** * Heading */ $wp_customize->add_setting('site_switching', array( 'default' => '', 'sanitize_callback' => 'esc_html', )); $wp_customize->add_control(new Customizer_Heading_Control($wp_customize, 'site_switching', array( 'label' => __( 'Site Switch Control', 'aeen' ), 'section' => 'general_section', ))); // Switch for back to top button $wp_customize->add_setting( 'back_to_top', array( 'default' => $this->defaults['back_to_top'], 'transport' => 'refresh', 'sanitize_callback' => 'rttheme_switch_sanitization', ) ); $wp_customize->add_control( new Customizer_Switch_Control( $wp_customize, 'back_to_top', array( 'label' => __( 'Back to Top', 'aeen' ), 'section' => 'general_section', ) ) ); // Switch for custom cursor $wp_customize->add_setting( 'sticky_header', array( 'default' => $this->defaults['sticky_header'], 'transport' => 'refresh', 'sanitize_callback' => 'rttheme_switch_sanitization', ) ); $wp_customize->add_control( new Customizer_Switch_Control( $wp_customize, 'sticky_header', array( 'label' => __( 'Sticky Header', 'aeen' ), 'section' => 'general_section', ) ) ); // Switch for transparent header $wp_customize->add_setting( 'transparent_header', array( 'default' => $this->defaults['transparent_header'], 'transport' => 'refresh', 'sanitize_callback' => 'rttheme_switch_sanitization', ) ); $wp_customize->add_control( new Customizer_Switch_Control( $wp_customize, 'transparent_header', array( 'label' => __( 'Transparent Header', 'aeen' ), 'section' => 'general_section', ) ) ); // Switch for Socials $wp_customize->add_setting( 'socials', array( 'default' => $this->defaults['socials'], 'transport' => 'refresh', 'sanitize_callback' => 'rttheme_switch_sanitization', ) ); $wp_customize->add_control( new Customizer_Switch_Control( $wp_customize, 'socials', array( 'label' => __( 'Socials', 'aeen' ), 'section' => 'general_section', ) ) ); // Facebook $wp_customize->add_setting( 'social_facebook', array( 'default' => $this->defaults['social_facebook'], 'transport' => 'refresh', 'sanitize_callback' => 'rttheme_text_sanitization', 'active_callback' => 'rttheme_is_socials_enabled', ) ); $wp_customize->add_control( 'social_facebook', array( 'label' => __( 'Facebook', 'aeen' ), 'section' => 'general_section', 'type' => 'text', 'active_callback' => 'rttheme_is_socials_enabled', ) ); // Twitter $wp_customize->add_setting( 'social_twitter', array( 'default' => $this->defaults['social_twitter'], 'transport' => 'refresh', 'sanitize_callback' => 'rttheme_text_sanitization', 'active_callback' => 'rttheme_is_socials_enabled', ) ); $wp_customize->add_control( 'social_twitter', array( 'label' => __( 'Twitter', 'aeen' ), 'section' => 'general_section', 'type' => 'text', 'active_callback' => 'rttheme_is_socials_enabled', ) ); // Behance $wp_customize->add_setting( 'social_behance', array( 'default' => $this->defaults['social_behance'], 'transport' => 'refresh', 'sanitize_callback' => 'rttheme_text_sanitization', 'active_callback' => 'rttheme_is_socials_enabled', ) ); $wp_customize->add_control( 'social_behance', array( 'label' => __( 'Behance', 'aeen' ), 'section' => 'general_section', 'type' => 'text', 'active_callback' => 'rttheme_is_socials_enabled', ) ); // Pinterest $wp_customize->add_setting( 'social_pinterest', array( 'default' => $this->defaults['social_pinterest'], 'transport' => 'refresh', 'sanitize_callback' => 'rttheme_text_sanitization', 'active_callback' => 'rttheme_is_socials_enabled', ) ); $wp_customize->add_control( 'social_pinterest', array( 'label' => __( 'Pinterest', 'aeen' ), 'section' => 'general_section', 'type' => 'text', 'active_callback' => 'rttheme_is_socials_enabled', ) ); // Google Plus $wp_customize->add_setting( 'social_gplus', array( 'default' => $this->defaults['social_gplus'], 'transport' => 'refresh', 'sanitize_callback' => 'rttheme_text_sanitization', 'active_callback' => 'rttheme_is_socials_enabled', ) ); $wp_customize->add_control( 'social_gplus', array( 'label' => __( 'Google Plus', 'aeen' ), 'section' => 'general_section', 'type' => 'text', 'active_callback' => 'rttheme_is_socials_enabled', ) ); // Linkedin $wp_customize->add_setting( 'social_linkedin', array( 'default' => $this->defaults['social_linkedin'], 'transport' => 'refresh', 'sanitize_callback' => 'rttheme_text_sanitization', 'active_callback' => 'rttheme_is_socials_enabled', ) ); $wp_customize->add_control( 'social_linkedin', array( 'label' => __( 'Linkedin', 'aeen' ), 'section' => 'general_section', 'type' => 'text', 'active_callback' => 'rttheme_is_socials_enabled', ) ); // Dribbble $wp_customize->add_setting( 'social_dribbble', array( 'default' => $this->defaults['social_dribbble'], 'transport' => 'refresh', 'sanitize_callback' => 'rttheme_text_sanitization', 'active_callback' => 'rttheme_is_socials_enabled', ) ); $wp_customize->add_control( 'social_dribbble', array( 'label' => __( 'Dribbble', 'aeen' ), 'section' => 'general_section', 'type' => 'text', 'active_callback' => 'rttheme_is_socials_enabled', ) ); // Youtube $wp_customize->add_setting( 'social_youtube', array( 'default' => $this->defaults['social_youtube'], 'transport' => 'refresh', 'sanitize_callback' => 'rttheme_text_sanitization', 'active_callback' => 'rttheme_is_socials_enabled', ) ); $wp_customize->add_control( 'social_youtube', array( 'label' => __( 'Youtube', 'aeen' ), 'section' => 'general_section', 'type' => 'text', 'active_callback' => 'rttheme_is_socials_enabled', ) ); // Instagram $wp_customize->add_setting( 'social_instagram', array( 'default' => $this->defaults['social_instagram'], 'transport' => 'refresh', 'sanitize_callback' => 'rttheme_text_sanitization', 'active_callback' => 'rttheme_is_socials_enabled', ) ); $wp_customize->add_control( 'social_instagram', array( 'label' => __( 'Instagram', 'aeen' ), 'section' => 'general_section', 'type' => 'text', 'active_callback' => 'rttheme_is_socials_enabled', ) ); // Skype $wp_customize->add_setting( 'social_skype', array( 'default' => $this->defaults['social_skype'], 'transport' => 'refresh', 'sanitize_callback' => 'rttheme_text_sanitization', 'active_callback' => 'rttheme_is_socials_enabled', ) ); $wp_customize->add_control( 'social_skype', array( 'label' => __( 'Skype', 'aeen' ), 'section' => 'general_section', 'type' => 'text', 'active_callback' => 'rttheme_is_socials_enabled', ) ); } } /** * Initialise our Customizer settings only when they're required */ if ( class_exists( 'WP_Customize_Control' ) ) { new RDTheme_General_Settings(); }