Make WordPress Core

Ticket #33738: 33738.0.diff

File 33738.0.diff, 5.7 KB (added by westonruter, 8 years ago)
  • src/wp-content/themes/twentyeleven/inc/theme-options.php

    diff --git src/wp-content/themes/twentyeleven/inc/theme-options.php src/wp-content/themes/twentyeleven/inc/theme-options.php
    index fd144b6..7d30140 100644
    function twentyeleven_customize_register( $wp_customize ) { 
    510510        $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage';
    511511        $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage';
    512512
     513        if ( isset( $wp_customize->selective_refresh ) ) {
     514                $wp_customize->selective_refresh->add_partial( 'blogname', array(
     515                        'selector' => '#site-title a',
     516                        'container_inclusive' => false,
     517                        'render_callback' => function() {
     518                                bloginfo( 'name' );
     519                        },
     520                ) );
     521                $wp_customize->selective_refresh->add_partial( 'blogdescription', array(
     522                        'selector' => '#site-description',
     523                        'container_inclusive' => false,
     524                        'render_callback' => function() {
     525                                bloginfo( 'description' );
     526                        },
     527                ) );
     528        }
     529
    513530        $options  = twentyeleven_get_theme_options();
    514531        $defaults = twentyeleven_get_default_theme_options();
    515532
  • src/wp-content/themes/twentyfifteen/inc/customizer.php

    diff --git src/wp-content/themes/twentyfifteen/inc/customizer.php src/wp-content/themes/twentyfifteen/inc/customizer.php
    index 93b66e5..d04ad29 100644
    function twentyfifteen_customize_register( $wp_customize ) { 
    2020        $wp_customize->get_setting( 'blogname' )->transport        = 'postMessage';
    2121        $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage';
    2222
     23        if ( isset( $wp_customize->selective_refresh ) ) {
     24                $wp_customize->selective_refresh->add_partial( 'blogname', array(
     25                        'selector' => '.site-title a',
     26                        'container_inclusive' => false,
     27                        'render_callback' => function() {
     28                                bloginfo( 'name' );
     29                        },
     30                ) );
     31                $wp_customize->selective_refresh->add_partial( 'blogdescription', array(
     32                        'selector' => '.site-description',
     33                        'container_inclusive' => false,
     34                        'render_callback' => function() {
     35                                bloginfo( 'description' );
     36                        },
     37                ) );
     38        }
     39
    2340        // Add color scheme setting and control.
    2441        $wp_customize->add_setting( 'color_scheme', array(
    2542                'default'           => 'default',
  • src/wp-content/themes/twentyfourteen/inc/customizer.php

    diff --git src/wp-content/themes/twentyfourteen/inc/customizer.php src/wp-content/themes/twentyfourteen/inc/customizer.php
    index 063d54c..88caff1 100644
    function twentyfourteen_customize_register( $wp_customize ) { 
    2020        $wp_customize->get_setting( 'blogdescription' )->transport  = 'postMessage';
    2121        $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage';
    2222
     23        if ( isset( $wp_customize->selective_refresh ) ) {
     24                $wp_customize->selective_refresh->add_partial( 'blogname', array(
     25                        'selector' => '.site-title a',
     26                        'container_inclusive' => false,
     27                        'render_callback' => function() {
     28                                bloginfo( 'name' );
     29                        },
     30                ) );
     31                $wp_customize->selective_refresh->add_partial( 'blogdescription', array(
     32                        'selector' => '.site-description',
     33                        'container_inclusive' => false,
     34                        'render_callback' => function() {
     35                                bloginfo( 'description' );
     36                        },
     37                ) );
     38        }
     39
    2340        // Rename the label to "Site Title Color" because this only affects the site title in this theme.
    2441        $wp_customize->get_control( 'header_textcolor' )->label = __( 'Site Title Color', 'twentyfourteen' );
    2542
  • src/wp-content/themes/twentythirteen/functions.php

    diff --git src/wp-content/themes/twentythirteen/functions.php src/wp-content/themes/twentythirteen/functions.php
    index 27b44e4..9912290 100644
    function twentythirteen_customize_register( $wp_customize ) { 
    535535        $wp_customize->get_setting( 'blogname' )->transport         = 'postMessage';
    536536        $wp_customize->get_setting( 'blogdescription' )->transport  = 'postMessage';
    537537        $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage';
     538
     539        if ( isset( $wp_customize->selective_refresh ) ) {
     540                $wp_customize->selective_refresh->add_partial( 'blogname', array(
     541                        'selector' => '.site-title',
     542                        'container_inclusive' => false,
     543                        'render_callback' => function() {
     544                                bloginfo( 'name' );
     545                        },
     546                ) );
     547                $wp_customize->selective_refresh->add_partial( 'blogdescription', array(
     548                        'selector' => '.site-description',
     549                        'container_inclusive' => false,
     550                        'render_callback' => function() {
     551                                bloginfo( 'description' );
     552                        },
     553                ) );
     554        }
    538555}
    539556add_action( 'customize_register', 'twentythirteen_customize_register' );
    540557
  • src/wp-content/themes/twentytwelve/functions.php

    diff --git src/wp-content/themes/twentytwelve/functions.php src/wp-content/themes/twentytwelve/functions.php
    index 8d5facf..4afd394 100644
    function twentytwelve_customize_register( $wp_customize ) { 
    480480        $wp_customize->get_setting( 'blogname' )->transport         = 'postMessage';
    481481        $wp_customize->get_setting( 'blogdescription' )->transport  = 'postMessage';
    482482        $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage';
     483
     484        if ( isset( $wp_customize->selective_refresh ) ) {
     485                $wp_customize->selective_refresh->add_partial( 'blogname', array(
     486                        'selector' => '.site-title > a',
     487                        'container_inclusive' => false,
     488                        'render_callback' => function() {
     489                                bloginfo( 'name' );
     490                        },
     491                ) );
     492                $wp_customize->selective_refresh->add_partial( 'blogdescription', array(
     493                        'selector' => '.site-description',
     494                        'container_inclusive' => false,
     495                        'render_callback' => function() {
     496                                bloginfo( 'description' );
     497                        },
     498                ) );
     499        }
    483500}
    484501add_action( 'customize_register', 'twentytwelve_customize_register' );
    485502