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.

Built from https://develop.svn.wordpress.org/trunk@36388


git-svn-id: http://core.svn.wordpress.org/trunk@36355 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Weston Ruter 2016-01-23 23:15:27 +00:00
parent 00cf77999d
commit 57c2b5d192
5 changed files with 10 additions and 5 deletions

View File

@ -132,7 +132,7 @@ do_action( 'customize_controls_print_scripts' );
<div id="customize-info" class="accordion-section customize-info">
<div class="accordion-section-title">
<span class="preview-notice"><?php
echo sprintf( __( 'You are customizing %s' ), '<strong class="panel-title site-title">' . get_bloginfo( 'name' ) . '</strong>' );
echo sprintf( __( 'You are customizing %s' ), '<strong class="panel-title site-title">' . __( 'Loading&hellip;' ) . '</strong>' );
?></span>
<button class="customize-help-toggle dashicons dashicons-editor-help" aria-expanded="false"><span class="screen-reader-text"><?php _e( 'Help' ); ?></span></button>
</div>

View File

@ -3604,8 +3604,12 @@
// Bind site title display to the corresponding field.
if ( title.length ) {
$( '#customize-control-blogname input' ).on( 'input', function() {
title.text( this.value );
api( 'blogname', function( setting ) {
var updateTitle = function() {
title.text( $.trim( setting() ) || api.l10n.untitledBlogName );
};
setting.bind( updateTitle );
updateTitle();
} );
}

File diff suppressed because one or more lines are too long

View File

@ -443,6 +443,7 @@ function wp_default_scripts( &$scripts ) {
'loginIframeTitle' => __( 'Session expired' ),
'collapseSidebar' => __( 'Collapse Sidebar' ),
'expandSidebar' => __( 'Expand Sidebar' ),
'untitledBlogName' => __( '(Untitled)' ),
// Used for overriding the file types allowed in plupload.
'allowedFiles' => __( 'Allowed Files' ),
) );

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.5-alpha-36387';
$wp_version = '4.5-alpha-36388';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.