get_setting( 'blogname' )->transport = 'postMessage'; $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage'; $wp_customize->get_section( 'colors' )->panel = 'custom_colors'; $wp_customize->get_section( 'colors' )->priority = '1'; $wp_customize->get_section( 'background_image' )->panel = 'background'; $wp_customize->get_section( 'background_image' )->priority = '10'; } add_action( 'customize_register', 'stainedglass_customize_register' ); /** * Add custom css styles for the Customizer screen. * * @since Stained Glass 1.0.3 */ function stainedglass_customize_controls_enqueue_scripts() { wp_enqueue_style( 'stainedglass-customize-css', get_template_directory_uri() . '/inc/css/customize.css', array(), null ); wp_enqueue_script( 'stainedglass-customize-control-js', get_template_directory_uri() . '/inc/js/customize.js', array( 'jquery' ), false, true ); } add_action('customize_controls_enqueue_scripts', 'stainedglass_customize_controls_enqueue_scripts'); /** * Add custom styles to the header. * * @since Stained Glass 1.0.0 */ function stainedglass_hook_css() { $defaults = stainedglass_get_defaults(); global $stainedglass_colors_class; $colors = $stainedglass_colors_class; $position = stainedglass_column_dir(); $top = get_theme_mod('top', $defaults['top']); ?> array( 'href' => array(), 'title' => array() ), 'br' => array(), 'em' => array(), 'strong' => array(), ) ); } /** * Sanitize hex color. * * @param string $value Value to sanitize. * @return sanitized value. * @since Stained Glass 1.0.0 */ function stainedglass_sanitize_content_width( $value ) { $value = absint($value); $value = ($value > 1349 ? 1349 : ($value < 500 ? 500 : $value)); return $value; } /** * Sanitize scroll button. * * @param string $value Value to sanitize. * @return sanitized value. * @since Stained Glass 1.0.0 */ function stainedglass_sanitize_scroll_button( $value ) { $possible_values = array( 'none', 'right', 'left', 'center'); return ( in_array( $value, $possible_values ) ? $value : 'right' ); } /** * Sanitize scroll css3 effect. * * @param string $value Value to sanitize. * @return sanitized value. * @since Stained Glass 1.0.0 */ function stainedglass_sanitize_scroll_effect( $value ) { $possible_values = array( 'none', 'move'); return ( in_array( $value, $possible_values ) ? $value : 'move' ); } /** * Sanitize opacity. * * @param string $value Value to sanitize. * @return sanitized value. * @since Stained Glass 1.0.0 */ function stainedglass_sanitize_opacity( $value ) { $possible_values = array ( '0', '0.1', '0.2', '0.3', '0.4', '0.5', '0.6', '0.7', '0.8', '0.9', '1'); return ( in_array( $value, $possible_values ) ? $value : '0.3' ); } /** * Return string Sanitized backgroind position * * @since Stained Glass 1.0.0 */ function stainedglass_sanitize_background_position( $value ) { $possible_values = array( 'top', 'center', 'bottom'); return ( in_array( $value, $possible_values ) ? $value : 'top' ); }