Make WordPress Core


Ignore:
Timestamp:
11/11/2014 10:28:38 PM (11 years ago)
Author:
ocean90
Message:

Customizer: When navigating around the site within the Customizer preview, update the document title.

props westonruter.
fixes #28542.

File:
1 edited

Legend:

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

    r30164 r30306  
    7777$is_ios = wp_is_mobile() && preg_match( '/iPad|iPod|iPhone/', $_SERVER['HTTP_USER_AGENT'] );
    7878
    79 if ( $is_ios )
     79if ( $is_ios ) {
    8080    $body_class .= ' ios';
    81 
    82 if ( is_rtl() )
    83     $body_class .=  ' rtl';
     81}
     82
     83if ( is_rtl() ) {
     84    $body_class .= ' rtl';
     85}
    8486$body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_locale() ) ) );
    8587
    86 $admin_title = sprintf( __( '%1$s — WordPress' ), strip_tags( sprintf( __( 'Customize %s' ), $wp_customize->theme()->display('Name') ) ) );
     88if ( $wp_customize->is_theme_active() ) {
     89    $document_title_tmpl = _x( 'Customize: %s', 'Placeholder is the document title from the preview' );
     90} else {
     91    $document_title_tmpl = _x( 'Live Preview: %s', 'Placeholder is the document title from the preview' );
     92}
     93$document_title_tmpl = html_entity_decode( $document_title_tmpl, ENT_QUOTES, 'UTF-8' ); // because exported to JS and assigned to document.title
     94$admin_title = sprintf( $document_title_tmpl, __( 'Loading…' ) );
     95
    8796?><title><?php echo $admin_title; ?></title>
    8897
     
    254263        ),
    255264        'autofocus' => array(),
     265        'documentTitleTmpl' => $document_title_tmpl,
    256266    );
    257267
Note: See TracChangeset for help on using the changeset viewer.