Make WordPress Core

Ticket #33738: 33738.1.diff

File 33738.1.diff, 9.3 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..e71ab9a 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' => 'twentyeleven_customize_partial_blogname',
     518                ) );
     519                $wp_customize->selective_refresh->add_partial( 'blogdescription', array(
     520                        'selector' => '#site-description',
     521                        'container_inclusive' => false,
     522                        'render_callback' => 'twentyeleven_customize_partial_blogdescription',
     523                ) );
     524        }
     525
    513526        $options  = twentyeleven_get_theme_options();
    514527        $defaults = twentyeleven_get_default_theme_options();
    515528
    function twentyeleven_customize_register( $wp_customize ) { 
    575588add_action( 'customize_register', 'twentyeleven_customize_register' );
    576589
    577590/**
     591 * Render the site title for the selective refresh partial.
     592 *
     593 * @since Twenty Eleven 2.4
     594 * @see twentyeleven_customize_register()
     595 *
     596 * @return void
     597 */
     598function twentyeleven_customize_partial_blogname() {
     599        bloginfo( 'name' );
     600}
     601
     602/**
     603 * Render the site tagline for the selective refresh partial.
     604 *
     605 * @since Twenty Eleven 2.4
     606 * @see twentyeleven_customize_register()
     607 *
     608 * @return void
     609 */
     610function twentyeleven_customize_partial_blogdescription() {
     611        bloginfo( 'description' );
     612}
     613
     614/**
    578615 * Bind JS handlers to make Customizer preview reload changes asynchronously.
    579616 *
    580617 * Used with blogname and blogdescription.
  • 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..c31c57e 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' => 'twentyfifteen_customize_partial_blogname',
     28                ) );
     29                $wp_customize->selective_refresh->add_partial( 'blogdescription', array(
     30                        'selector' => '.site-description',
     31                        'container_inclusive' => false,
     32                        'render_callback' => 'twentyfifteen_customize_partial_blogdescription',
     33                ) );
     34        }
     35
    2336        // Add color scheme setting and control.
    2437        $wp_customize->add_setting( 'color_scheme', array(
    2538                'default'           => 'default',
    function twentyfifteen_customize_register( $wp_customize ) { 
    7083add_action( 'customize_register', 'twentyfifteen_customize_register', 11 );
    7184
    7285/**
     86 * Render the site title for the selective refresh partial.
     87 *
     88 * @since Twenty Fifteen 1.5
     89 * @see twentyfifteen_customize_register()
     90 *
     91 * @return void
     92 */
     93function twentyfifteen_customize_partial_blogname() {
     94        bloginfo( 'name' );
     95}
     96
     97/**
     98 * Render the site tagline for the selective refresh partial.
     99 *
     100 * @since Twenty Fifteen 1.5
     101 * @see twentyfifteen_customize_register()
     102 *
     103 * @return void
     104 */
     105function twentyfifteen_customize_partial_blogdescription() {
     106        bloginfo( 'description' );
     107}
     108
     109/**
    73110 * Register color schemes for Twenty Fifteen.
    74111 *
    75112 * Can be filtered with {@see 'twentyfifteen_color_schemes'}.
  • 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..4522984 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' => 'twentyfourteen_customize_partial_blogname',
     28                ) );
     29                $wp_customize->selective_refresh->add_partial( 'blogdescription', array(
     30                        'selector' => '.site-description',
     31                        'container_inclusive' => false,
     32                        'render_callback' => 'twentyfourteen_customize_partial_blogdescription',
     33                ) );
     34        }
     35
    2336        // Rename the label to "Site Title Color" because this only affects the site title in this theme.
    2437        $wp_customize->get_control( 'header_textcolor' )->label = __( 'Site Title Color', 'twentyfourteen' );
    2538
    function twentyfourteen_customize_register( $wp_customize ) { 
    6578add_action( 'customize_register', 'twentyfourteen_customize_register' );
    6679
    6780/**
     81 * Render the site title for the selective refresh partial.
     82 *
     83 * @since Twenty Fourteen 1.7
     84 * @see twentyfourteen_customize_register()
     85 *
     86 * @return void
     87 */
     88function twentyfourteen_customize_partial_blogname() {
     89        bloginfo( 'name' );
     90}
     91
     92/**
     93 * Render the site tagline for the selective refresh partial.
     94 *
     95 * @since Twenty Fourteen 1.7
     96 * @see twentyfourteen_customize_register()
     97 *
     98 * @return void
     99 */
     100function twentyfourteen_customize_partial_blogdescription() {
     101        bloginfo( 'description' );
     102}
     103
     104/**
    68105 * Sanitize the Featured Content layout value.
    69106 *
    70107 * @since Twenty Fourteen 1.0
  • 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..33c8efd 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' => 'twentythirteen_customize_partial_blogname',
     544                ) );
     545                $wp_customize->selective_refresh->add_partial( 'blogdescription', array(
     546                        'selector' => '.site-description',
     547                        'container_inclusive' => false,
     548                        'render_callback' => 'twentythirteen_customize_partial_blogdescription',
     549                ) );
     550        }
    538551}
    539552add_action( 'customize_register', 'twentythirteen_customize_register' );
    540553
    541554/**
     555 * Render the site title for the selective refresh partial.
     556 *
     557 * @since Twenty Thirteen 1.9
     558 * @see twentythirteen_customize_register()
     559 *
     560 * @return void
     561 */
     562function twentythirteen_customize_partial_blogname() {
     563        bloginfo( 'name' );
     564}
     565
     566/**
     567 * Render the site tagline for the selective refresh partial.
     568 *
     569 * @since Twenty Thirteen 1.9
     570 * @see twentythirteen_customize_register()
     571 *
     572 * @return void
     573 */
     574function twentythirteen_customize_partial_blogdescription() {
     575        bloginfo( 'description' );
     576}
     577
     578/**
    542579 * Enqueue Javascript postMessage handlers for the Customizer.
    543580 *
    544581 * Binds JavaScript handlers to make the Customizer preview
  • 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..63f903e 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' => 'twentytwelve_customize_partial_blogname',
     489                ) );
     490                $wp_customize->selective_refresh->add_partial( 'blogdescription', array(
     491                        'selector' => '.site-description',
     492                        'container_inclusive' => false,
     493                        'render_callback' => 'twentytwelve_customize_partial_blogdescription',
     494                ) );
     495        }
    483496}
    484497add_action( 'customize_register', 'twentytwelve_customize_register' );
    485498
    486499/**
     500 * Render the site title for the selective refresh partial.
     501 *
     502 * @since Twenty Twelve 2.0
     503 * @see twentytwelve_customize_register()
     504 *
     505 * @return void
     506 */
     507function twentytwelve_customize_partial_blogname() {
     508        bloginfo( 'name' );
     509}
     510
     511/**
     512 * Render the site tagline for the selective refresh partial.
     513 *
     514 * @since Twenty Twelve 2.0
     515 * @see twentytwelve_customize_register()
     516 *
     517 * @return void
     518 */
     519function twentytwelve_customize_partial_blogdescription() {
     520        bloginfo( 'description' );
     521}
     522
     523/**
    487524 * Enqueue Javascript postMessage handlers for the Customizer.
    488525 *
    489526 * Binds JS handlers to make the Customizer preview reload changes asynchronously.