diff --git a/src/wp-content/themes/twentyeleven/inc/theme-options.php b/src/wp-content/themes/twentyeleven/inc/theme-options.php index fd144b65fc..e71ab9a167 100644 --- a/src/wp-content/themes/twentyeleven/inc/theme-options.php +++ b/src/wp-content/themes/twentyeleven/inc/theme-options.php @@ -510,6 +510,19 @@ function twentyeleven_customize_register( $wp_customize ) { $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage'; + if ( isset( $wp_customize->selective_refresh ) ) { + $wp_customize->selective_refresh->add_partial( 'blogname', array( + 'selector' => '#site-title a', + 'container_inclusive' => false, + 'render_callback' => 'twentyeleven_customize_partial_blogname', + ) ); + $wp_customize->selective_refresh->add_partial( 'blogdescription', array( + 'selector' => '#site-description', + 'container_inclusive' => false, + 'render_callback' => 'twentyeleven_customize_partial_blogdescription', + ) ); + } + $options = twentyeleven_get_theme_options(); $defaults = twentyeleven_get_default_theme_options(); @@ -574,6 +587,30 @@ function twentyeleven_customize_register( $wp_customize ) { } add_action( 'customize_register', 'twentyeleven_customize_register' ); +/** + * Render the site title for the selective refresh partial. + * + * @since Twenty Eleven 2.4 + * @see twentyeleven_customize_register() + * + * @return void + */ +function twentyeleven_customize_partial_blogname() { + bloginfo( 'name' ); +} + +/** + * Render the site tagline for the selective refresh partial. + * + * @since Twenty Eleven 2.4 + * @see twentyeleven_customize_register() + * + * @return void + */ +function twentyeleven_customize_partial_blogdescription() { + bloginfo( 'description' ); +} + /** * Bind JS handlers to make Customizer preview reload changes asynchronously. * diff --git a/src/wp-content/themes/twentyfifteen/inc/customizer.php b/src/wp-content/themes/twentyfifteen/inc/customizer.php index 93b66e5eae..c31c57e8df 100644 --- a/src/wp-content/themes/twentyfifteen/inc/customizer.php +++ b/src/wp-content/themes/twentyfifteen/inc/customizer.php @@ -20,6 +20,19 @@ function twentyfifteen_customize_register( $wp_customize ) { $wp_customize->get_setting( 'blogname' )->transport = 'postMessage'; $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; + if ( isset( $wp_customize->selective_refresh ) ) { + $wp_customize->selective_refresh->add_partial( 'blogname', array( + 'selector' => '.site-title a', + 'container_inclusive' => false, + 'render_callback' => 'twentyfifteen_customize_partial_blogname', + ) ); + $wp_customize->selective_refresh->add_partial( 'blogdescription', array( + 'selector' => '.site-description', + 'container_inclusive' => false, + 'render_callback' => 'twentyfifteen_customize_partial_blogdescription', + ) ); + } + // Add color scheme setting and control. $wp_customize->add_setting( 'color_scheme', array( 'default' => 'default', @@ -69,6 +82,30 @@ function twentyfifteen_customize_register( $wp_customize ) { } add_action( 'customize_register', 'twentyfifteen_customize_register', 11 ); +/** + * Render the site title for the selective refresh partial. + * + * @since Twenty Fifteen 1.5 + * @see twentyfifteen_customize_register() + * + * @return void + */ +function twentyfifteen_customize_partial_blogname() { + bloginfo( 'name' ); +} + +/** + * Render the site tagline for the selective refresh partial. + * + * @since Twenty Fifteen 1.5 + * @see twentyfifteen_customize_register() + * + * @return void + */ +function twentyfifteen_customize_partial_blogdescription() { + bloginfo( 'description' ); +} + /** * Register color schemes for Twenty Fifteen. * diff --git a/src/wp-content/themes/twentyfourteen/inc/customizer.php b/src/wp-content/themes/twentyfourteen/inc/customizer.php index 063d54c3e1..45229847e8 100644 --- a/src/wp-content/themes/twentyfourteen/inc/customizer.php +++ b/src/wp-content/themes/twentyfourteen/inc/customizer.php @@ -20,6 +20,19 @@ function twentyfourteen_customize_register( $wp_customize ) { $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage'; + if ( isset( $wp_customize->selective_refresh ) ) { + $wp_customize->selective_refresh->add_partial( 'blogname', array( + 'selector' => '.site-title a', + 'container_inclusive' => false, + 'render_callback' => 'twentyfourteen_customize_partial_blogname', + ) ); + $wp_customize->selective_refresh->add_partial( 'blogdescription', array( + 'selector' => '.site-description', + 'container_inclusive' => false, + 'render_callback' => 'twentyfourteen_customize_partial_blogdescription', + ) ); + } + // Rename the label to "Site Title Color" because this only affects the site title in this theme. $wp_customize->get_control( 'header_textcolor' )->label = __( 'Site Title Color', 'twentyfourteen' ); @@ -64,6 +77,30 @@ function twentyfourteen_customize_register( $wp_customize ) { } add_action( 'customize_register', 'twentyfourteen_customize_register' ); +/** + * Render the site title for the selective refresh partial. + * + * @since Twenty Fourteen 1.7 + * @see twentyfourteen_customize_register() + * + * @return void + */ +function twentyfourteen_customize_partial_blogname() { + bloginfo( 'name' ); +} + +/** + * Render the site tagline for the selective refresh partial. + * + * @since Twenty Fourteen 1.7 + * @see twentyfourteen_customize_register() + * + * @return void + */ +function twentyfourteen_customize_partial_blogdescription() { + bloginfo( 'description' ); +} + /** * Sanitize the Featured Content layout value. * diff --git a/src/wp-content/themes/twentythirteen/functions.php b/src/wp-content/themes/twentythirteen/functions.php index 27b44e4e12..33c8efd9aa 100644 --- a/src/wp-content/themes/twentythirteen/functions.php +++ b/src/wp-content/themes/twentythirteen/functions.php @@ -535,9 +535,46 @@ function twentythirteen_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'; + + if ( isset( $wp_customize->selective_refresh ) ) { + $wp_customize->selective_refresh->add_partial( 'blogname', array( + 'selector' => '.site-title', + 'container_inclusive' => false, + 'render_callback' => 'twentythirteen_customize_partial_blogname', + ) ); + $wp_customize->selective_refresh->add_partial( 'blogdescription', array( + 'selector' => '.site-description', + 'container_inclusive' => false, + 'render_callback' => 'twentythirteen_customize_partial_blogdescription', + ) ); + } } add_action( 'customize_register', 'twentythirteen_customize_register' ); +/** + * Render the site title for the selective refresh partial. + * + * @since Twenty Thirteen 1.9 + * @see twentythirteen_customize_register() + * + * @return void + */ +function twentythirteen_customize_partial_blogname() { + bloginfo( 'name' ); +} + +/** + * Render the site tagline for the selective refresh partial. + * + * @since Twenty Thirteen 1.9 + * @see twentythirteen_customize_register() + * + * @return void + */ +function twentythirteen_customize_partial_blogdescription() { + bloginfo( 'description' ); +} + /** * Enqueue Javascript postMessage handlers for the Customizer. * diff --git a/src/wp-content/themes/twentytwelve/functions.php b/src/wp-content/themes/twentytwelve/functions.php index ef933e5136..e3054474ee 100644 --- a/src/wp-content/themes/twentytwelve/functions.php +++ b/src/wp-content/themes/twentytwelve/functions.php @@ -480,9 +480,46 @@ function twentytwelve_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'; + + if ( isset( $wp_customize->selective_refresh ) ) { + $wp_customize->selective_refresh->add_partial( 'blogname', array( + 'selector' => '.site-title > a', + 'container_inclusive' => false, + 'render_callback' => 'twentytwelve_customize_partial_blogname', + ) ); + $wp_customize->selective_refresh->add_partial( 'blogdescription', array( + 'selector' => '.site-description', + 'container_inclusive' => false, + 'render_callback' => 'twentytwelve_customize_partial_blogdescription', + ) ); + } } add_action( 'customize_register', 'twentytwelve_customize_register' ); +/** + * Render the site title for the selective refresh partial. + * + * @since Twenty Twelve 2.0 + * @see twentytwelve_customize_register() + * + * @return void + */ +function twentytwelve_customize_partial_blogname() { + bloginfo( 'name' ); +} + +/** + * Render the site tagline for the selective refresh partial. + * + * @since Twenty Twelve 2.0 + * @see twentytwelve_customize_register() + * + * @return void + */ +function twentytwelve_customize_partial_blogdescription() { + bloginfo( 'description' ); +} + /** * Enqueue Javascript postMessage handlers for the Customizer. *