| Server IP : 149.28.60.191 / Your IP : 216.73.217.128 Web Server : nginx/1.31.1 System : Linux vultr.guest 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 User : mda ( ) PHP Version : 7.4.33 Disable Function : getmyuid,passthru,leak,listen,diskfreespace,tmpfile,link,shell_exec,dl,exec,system,highlight_file,source,show_source,fpassthru,virtual,posix_ctermid,posix_getcwd,posix_getegid,posix_geteuid,posix_getgid,posix_getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid,posix_getppid,posix_getpwuid,posix_getrlimit,posix_getsid,posix_getuid,posix_isatty,posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid,posix_setpgid,posix_setsid,posix_setuid,posix_times,posix_ttyname,posix_uname,proc_open,proc_close,proc_nice,proc_terminate,escapeshellcmd,ini_alter,popen,pcntl_exec,socket_accept,socket_bind,socket_clear_error,socket_close,socket_connect,symlink,posix_geteuid,ini_alter,socket_listen,socket_create_listen,socket_read,socket_create_pair,stream_socket_server MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /home/mda/webapps/mda-restore/wp-content/themes/sketch/inc/ |
Upload File : |
<?php
/**
* Sketch Theme Customizer
*
* @package Sketch
*/
/**
* Add postMessage support for site title and description for the Theme Customizer.
*
* @param WP_Customize_Manager $wp_customize Theme Customizer object.
*/
function sketch_customize_register( $wp_customize ) {
$wp_customize->get_setting( 'blogname' )->transport = 'postMessage';
$wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage';
$wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage';
$wp_customize->add_setting( 'sketch_portfolio_thumbnail', array(
'default' => 'landscape',
'sanitize_callback' => 'sketch_sanitize_ratio',
) );
$wp_customize->add_control( 'sketch_portfolio_thumbnail', array(
'label' => __( 'Portfolio Thumbnail Aspect Ratio', 'sketch' ),
'section' => 'jetpack_portfolio',
'type' => 'select',
'choices' => array(
'landscape' => __( 'Landscape (4:3)', 'sketch' ),
'portrait' => __( 'Portrait (3:4)', 'sketch' ),
'square' => __( 'Square (1:1)', 'sketch' ),
),
) );
$wp_customize->add_setting( 'sketch_hide_portfolio_page_content', array(
'default' => '',
'sanitize_callback' => 'sketch_sanitize_checkbox',
) );
$wp_customize->add_control( 'sketch_hide_portfolio_page_content', array(
'label' => __( 'Hide title and content on Portfolio Page Template', 'sketch' ),
'section' => 'jetpack_portfolio',
'type' => 'checkbox',
) );
}
add_action( 'customize_register', 'sketch_customize_register' );
/**
* Binds JS handlers to make Theme Customizer preview reload changes asynchronously.
*/
function sketch_customize_preview_js() {
wp_enqueue_script( 'sketch_customizer', get_template_directory_uri() . '/js/customizer.js', array( 'customize-preview' ), '20130508', true );
}
add_action( 'customize_preview_init', 'sketch_customize_preview_js' );
/**
* Sanitize the checkbox.
*
* @param boolean $input.
* @return boolean true if portfolio page template displays title and content.
*/
function sketch_sanitize_checkbox( $input ) {
if ( 1 == $input ) {
return true;
} else {
return false;
}
}
/**
* Sanitize the Portfolio Thumbnail Aspect Ratio value.
*
* @param string $ratio Aspect ratio.
* @return string Filtered ratio (landscape|portrait|square).
*/
function sketch_sanitize_ratio( $ratio ) {
if ( ! in_array( $ratio, array( 'landscape', 'portrait', 'square' ) ) ) {
$ratio = 'landscape';
}
return $ratio;
}