From 63642323a54568982777e7f2a3f96e41d82e5767 Mon Sep 17 00:00:00 2001 From: "Dominik Schilling (ocean90)" Date: Tue, 11 Nov 2014 22:28:38 +0000 Subject: [PATCH] Customizer: When navigating around the site within the Customizer preview, update the document title. props westonruter. fixes #28542. git-svn-id: https://develop.svn.wordpress.org/trunk@30306 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/customize.php | 18 ++++++++++++++---- src/wp-admin/js/customize-controls.js | 20 ++++++++++++++++++++ src/wp-includes/js/customize-loader.js | 17 +++++++++++++---- src/wp-includes/js/customize-preview.js | 11 +++++++---- 4 files changed, 54 insertions(+), 12 deletions(-) diff --git a/src/wp-admin/customize.php b/src/wp-admin/customize.php index 1f85ec6c75..7ec8f90aed 100644 --- a/src/wp-admin/customize.php +++ b/src/wp-admin/customize.php @@ -76,14 +76,23 @@ endif; $is_ios = wp_is_mobile() && preg_match( '/iPad|iPod|iPhone/', $_SERVER['HTTP_USER_AGENT'] ); -if ( $is_ios ) +if ( $is_ios ) { $body_class .= ' ios'; +} -if ( is_rtl() ) - $body_class .= ' rtl'; +if ( is_rtl() ) { + $body_class .= ' rtl'; +} $body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_locale() ) ) ); -$admin_title = sprintf( __( '%1$s — WordPress' ), strip_tags( sprintf( __( 'Customize %s' ), $wp_customize->theme()->display('Name') ) ) ); +if ( $wp_customize->is_theme_active() ) { + $document_title_tmpl = _x( 'Customize: %s', 'Placeholder is the document title from the preview' ); +} else { + $document_title_tmpl = _x( 'Live Preview: %s', 'Placeholder is the document title from the preview' ); +} +$document_title_tmpl = html_entity_decode( $document_title_tmpl, ENT_QUOTES, 'UTF-8' ); // because exported to JS and assigned to document.title +$admin_title = sprintf( $document_title_tmpl, __( 'Loading…' ) ); + ?><?php echo $admin_title; ?>