X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/03f2fa83c13c1b532284205fa7efcab9b8b2c41f..784f914b1e4b1c62d6657e86397c2e83bcee4295:/wp-content/themes/twentyfifteen/inc/customizer.php?ds=sidebyside diff --git a/wp-content/themes/twentyfifteen/inc/customizer.php b/wp-content/themes/twentyfifteen/inc/customizer.php index 93b66e5e..c31c57e8 100644 --- a/wp-content/themes/twentyfifteen/inc/customizer.php +++ b/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. *