]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-content/themes/twentyfourteen/inc/customizer.php
WordPress 4.5
[autoinstalls/wordpress.git] / wp-content / themes / twentyfourteen / inc / customizer.php
index 063d54c3e1a7ac83eba69ec631773078747338b0..45229847e84095ea8fb33209ec99fac68ded1461 100644 (file)
@@ -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.
  *