From 6b98d184f6e7108323906e48fdba144262e79f7c Mon Sep 17 00:00:00 2001 From: Lance Willett Date: Tue, 26 Feb 2013 04:59:35 +0000 Subject: [PATCH] Twenty Thirteen: instantly preview header text color changes in the Theme Customizer. Fixes #23585, props SriniG. git-svn-id: https://develop.svn.wordpress.org/trunk@23493 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-content/themes/twentythirteen/functions.php | 7 ++++--- wp-content/themes/twentythirteen/js/theme-customizer.js | 8 +++++++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/wp-content/themes/twentythirteen/functions.php b/wp-content/themes/twentythirteen/functions.php index e6d274e926..295d9e23d9 100644 --- a/wp-content/themes/twentythirteen/functions.php +++ b/wp-content/themes/twentythirteen/functions.php @@ -552,8 +552,9 @@ add_filter( 'the_content', 'twentythirteen_aside_date', 8 ); // After embeds, be * @return void */ function twentythirteen_customize_register( $wp_customize ) { - $wp_customize->get_setting( 'blogname' )->transport = 'postMessage'; - $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; + $wp_customize->get_setting( 'blogname' )->transport = 'postMessage'; + $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; + $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage'; } add_action( 'customize_register', 'twentythirteen_customize_register' ); @@ -564,7 +565,7 @@ add_action( 'customize_register', 'twentythirteen_customize_register' ); * @since Twenty Thirteen 1.0 */ function twentythirteen_customize_preview_js() { - wp_enqueue_script( 'twentythirteen-customizer', get_template_directory_uri() . '/js/theme-customizer.js', array( 'customize-preview' ), '20130213', true ); + wp_enqueue_script( 'twentythirteen-customizer', get_template_directory_uri() . '/js/theme-customizer.js', array( 'customize-preview' ), '20130226', true ); } add_action( 'customize_preview_init', 'twentythirteen_customize_preview_js' ); diff --git a/wp-content/themes/twentythirteen/js/theme-customizer.js b/wp-content/themes/twentythirteen/js/theme-customizer.js index 8d14ae6c61..be1b67b25b 100644 --- a/wp-content/themes/twentythirteen/js/theme-customizer.js +++ b/wp-content/themes/twentythirteen/js/theme-customizer.js @@ -17,4 +17,10 @@ $( '.site-description' ).text( to ); } ); } ); -} )( jQuery ); \ No newline at end of file + // Header text color. + wp.customize( 'header_textcolor', function( value ) { + value.bind( function( to ) { + $( '.site-title, .site-description' ).css( 'color', to ); + } ); + } ); +} )( jQuery );