When live-updating site title in toolbar, fall back to the site url if the title is empty.

props avryl.
see #28682.
Built from https://develop.svn.wordpress.org/trunk@30597


git-svn-id: http://core.svn.wordpress.org/trunk@30587 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2014-11-28 08:12:23 +00:00
parent 0a8b72866e
commit 8c091940a3
2 changed files with 4 additions and 3 deletions

View File

@ -30,10 +30,11 @@ function options_general_add_js() {
<script type="text/javascript">
//<![CDATA[
jQuery(document).ready(function($){
var $siteName = $( '#wp-admin-bar-site-name' ).children( 'a' ).first();
var $siteName = $( '#wp-admin-bar-site-name' ).children( 'a' ).first(),
homeURL = ( <?php echo wp_json_encode( get_home_url() ); ?> || '' ).replace( /^(https?:\/\/)?(www\.)?/, '' );
$( '#blogname' ).on( 'input', function() {
var title = $( this ).val();
var title = $.trim( $( this ).val() ) || homeURL;
// Truncate to 40 characters.
if ( 40 < title.length ) {

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.1-beta2-30596';
$wp_version = '4.1-beta2-30597';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.