X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/0459461f9ea42e0b090759ff6fe5f48360bef750..refs/tags/wordpress-4.5:/wp-content/themes/twentyfourteen/inc/customizer.php diff --git a/wp-content/themes/twentyfourteen/inc/customizer.php b/wp-content/themes/twentyfourteen/inc/customizer.php index 063d54c3..45229847 100644 --- a/wp-content/themes/twentyfourteen/inc/customizer.php +++ b/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. *