When live-updating site title in toolbar, fall back to the site url if the title is empty.
props avryl. see #28682. git-svn-id: https://develop.svn.wordpress.org/trunk@30597 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
980ca1471b
commit
03cb69d8e2
|
@ -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 ) {
|
||||
|
|
Loading…
Reference in New Issue