WordPress.org

Make WordPress Core

Changeset 36388


Ignore:
Timestamp:
01/23/2016 11:14:10 PM (5 years ago)
Author:
westonruter
Message:

Customizer: Use "(Untitled)" as site title if blogname is empty.

Fixes a layout issue in the Customizer UI. Also de-duplicate title display logic, outputting "Loading..." as site title in PHP with actual title being set upon Customizer ready. Also update the site title in response to a blogname setting change as opposed to input DOM events on the control.

Fixes #35579.

Location:
trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/customize.php

    r34269 r36388  
    133133                <div class="accordion-section-title">
    134134                    <span class="preview-notice"><?php
    135                         echo sprintf( __( 'You are customizing %s' ), '<strong class="panel-title site-title">' . get_bloginfo( 'name' ) . '</strong>' );
     135                        echo sprintf( __( 'You are customizing %s' ), '<strong class="panel-title site-title">' . __( 'Loading&hellip;' ) . '</strong>' );
    136136                    ?></span>
    137137                    <button class="customize-help-toggle dashicons dashicons-editor-help" aria-expanded="false"><span class="screen-reader-text"><?php _e( 'Help' ); ?></span></button>
  • trunk/src/wp-admin/js/customize-controls.js

    r36383 r36388  
    36053605        // Bind site title display to the corresponding field.
    36063606        if ( title.length ) {
    3607             $( '#customize-control-blogname input' ).on( 'input', function() {
    3608                 title.text( this.value );
     3607            api( 'blogname', function( setting ) {
     3608                var updateTitle = function() {
     3609                    title.text( $.trim( setting() ) || api.l10n.untitledBlogName );
     3610                };
     3611                setting.bind( updateTitle );
     3612                updateTitle();
    36093613            } );
    36103614        }
  • trunk/src/wp-includes/script-loader.php

    r36341 r36388  
    444444        'collapseSidebar'    => __( 'Collapse Sidebar' ),
    445445        'expandSidebar'      => __( 'Expand Sidebar' ),
     446        'untitledBlogName'   => __( '(Untitled)' ),
    446447        // Used for overriding the file types allowed in plupload.
    447448        'allowedFiles'       => __( 'Allowed Files' ),
Note: See TracChangeset for help on using the changeset viewer.