| Server IP : 103.48.194.25 / Your IP : 216.73.217.33 Web Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.33 System : Linux VMHostDefault 3.10.0-1160.42.2.el7.x86_64 #1 SMP Tue Sep 7 14:49:57 UTC 2021 x86_64 User : sieuthimay ( 1016) PHP Version : 8.2.20 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/sieuthimayasia.com/public_html/wp-content/themes/mtw-maycn/inc/ |
Upload File : |
<?php
/**
* MTWTeam Customizer functionality.
*
* @package MTWTeam
* @since MTWTeam 1.0.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* Sets up the WordPress core custom header and custom background features.
*
* @since MTWTeam 1.0
*
* @see mtwfn_header_style()
*/
function mtwfn_custom_background() {
/**
* Filter the arguments used when adding 'custom-background' support in MTWTeam.
*
* @since MTWTeam 1.0
*
* @param array $args {
* An array of custom-background support arguments.
*
* @type string $default-color Default color of the background.
* }
*/
add_theme_support( 'custom-background', apply_filters( 'mtwfn_custom_background_args', array(
'default-color' => '#ffffff',
'default-attachment' => 'fixed',
) ) );
}
add_action( 'after_setup_theme', 'mtwfn_custom_background' );
/**
* MTW_Customizer_Manager Class.
*/
final class MTW_Customizer_Manager {
/**
* Register settings for the Theme Customizer.
*/
public static function init() {
add_action( 'customize_register', array( __CLASS__, 'register' ) );
}
/**
* Register settings for the Theme Customizer.
*
* @param WP_Customize_Manager $wp_customize Theme Customizer object.
*/
public static function register( WP_Customize_Manager $wp_customize ) {
static::register_facebook( $wp_customize );
static::register_footer( $wp_customize );
static::register_mobile_menu( $wp_customize );
}
/**
* Register Facebook setting for the Theme Customizer
*
* @param WP_Customize_Manager $wp_customize Theme Customizer object.
*/
public static function register_facebook( WP_Customize_Manager $wp_customize ) {
// Facebook section
$wp_customize->add_section( 'facebook', array(
'title' => esc_html__( 'Facebook', 'maycn' ),
'priority' => 500,
) );
// Facebook SDK JS.
$wp_customize->add_setting( 'fb_sdk_js', array(
'default' => mtwfn_defaults( 'fb_sdk_js' ),
'sanitize_callback' => array( __CLASS__, 'sanitize_value' ),
) );
$wp_customize->add_control( 'fb_sdk_js', array(
'type' => 'checkbox',
'section' => 'facebook',
'label' => esc_html__( 'Include Facebook SDK JS', 'maycn' ),
) );
// Facebook App ID.
$wp_customize->add_setting( 'facebook_app_id' , array(
'default' => mtwfn_defaults( 'facebook_app_id' ),
'sanitize_callback' => array( __CLASS__, 'sanitize_value' ),
) );
$wp_customize->add_control( 'facebook_app_id', array(
'type' => 'text',
'section' => 'facebook',
'label' => esc_html__( 'Facebook App ID', 'maycn' ),
'priority' => 1,
) );
// Facebook Language.
$wp_customize->add_setting( 'fb_language', array(
'default' => mtwfn_defaults( 'fb_language' ),
'sanitize_callback' => array( __CLASS__, 'sanitize_value' ),
) );
$wp_customize->add_control( 'fb_language', array(
'type' => 'select',
'section' => 'facebook',
'label' => esc_html__( 'Facebook Language', 'maycn' ),
'choices' => array(
'vi_VN' => esc_html__( 'Tiếng Việt', 'maycn' ),
'en_US' => esc_html__( 'English', 'maycn' ),
),
) );
}
/**
* Register Footer setting for the Theme Customizer
*
* @param WP_Customize_Manager $wp_customize Theme Customizer object.
*/
public static function register_footer( WP_Customize_Manager $wp_customize ) {
// Footer section
$wp_customize->add_section( 'footer', array(
'title' => esc_html__( 'Footer', 'maycn' ),
) );
// Footer SDK JS.
$wp_customize->add_setting( 'totop', array(
'default' => mtwfn_defaults( 'totop' ),
'sanitize_callback' => array( __CLASS__, 'sanitize_value' ),
) );
$wp_customize->add_control( 'totop', array(
'type' => 'checkbox',
'section' => 'footer',
'label' => esc_html__( 'Bật/Tắt nút cuộn lên đầu trang?', 'maycn' ),
) );
}
/**
* Register Mobile Menu setting for the Theme Customizer
*
* @param WP_Customize_Manager $wp_customize Theme Customizer object.
*/
public static function register_mobile_menu( WP_Customize_Manager $wp_customize ) {
$wp_customize->add_section( 'mobile_menu', array(
'title' => esc_html__( 'Mobile Menu', 'maycn' ),
'priority' => 600,
) );
// Display content as setting.
$wp_customize->add_setting( 'mobile_menu_phone', array(
'default' => mtwfn_defaults( 'mobile_menu_phone' ),
'sanitize_callback' => array( __CLASS__, 'sanitize_value' ),
) );
$wp_customize->add_control( 'mobile_menu_phone', array(
'type' => 'text',
'section' => 'mobile_menu',
'label' => esc_html__( 'Mobile Menu Phone:', 'maycn' ),
) );
// Display content as setting.
$wp_customize->add_setting( 'mobile_menu_email', array(
'default' => mtwfn_defaults( 'mobile_menu_email' ),
'sanitize_callback' => array( __CLASS__, 'sanitize_value' ),
) );
$wp_customize->add_control( 'mobile_menu_email', array(
'type' => 'text',
'section' => 'mobile_menu',
'label' => esc_html__( 'Mobile Menu Email:', 'maycn' ),
) );
// Display content as setting.
$wp_customize->add_setting( 'mobile_menu_facebook', array(
'default' => mtwfn_defaults( 'mobile_menu_facebook' ),
'sanitize_callback' => array( __CLASS__, 'sanitize_value' ),
) );
$wp_customize->add_control( 'mobile_menu_facebook', array(
'type' => 'text',
'section' => 'mobile_menu',
'label' => esc_html__( 'Mobile Menu Facebook:', 'maycn' ),
) );
}
/**
* Sanitize raw value.
*
* @param mixed $value Raw string value.
* @return string
*/
public static function sanitize_value( $value ) {
return $value;
}
}
/**
* Fire system settings.
*/
MTW_Customizer_Manager::init();