From b25006231146f919b36d41445b4bc9d30ff8f053 Mon Sep 17 00:00:00 2001 From: Dominik Schilling Date: Tue, 11 Nov 2014 22:29:23 +0000 Subject: [PATCH] Customizer: When navigating around the site within the Customizer preview, update the document title. props westonruter. fixes #28542. Built from https://develop.svn.wordpress.org/trunk@30306 git-svn-id: http://core.svn.wordpress.org/trunk@30305 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/customize.php | 18 ++++++++++++++---- wp-admin/js/customize-controls.js | 20 ++++++++++++++++++++ wp-admin/js/customize-controls.min.js | 2 +- wp-includes/js/customize-loader.js | 17 +++++++++++++---- wp-includes/js/customize-loader.min.js | 2 +- wp-includes/js/customize-preview.js | 11 +++++++---- wp-includes/js/customize-preview.min.js | 2 +- wp-includes/version.php | 2 +- 8 files changed, 58 insertions(+), 16 deletions(-) diff --git a/wp-admin/customize.php b/wp-admin/customize.php index 1f85ec6c75..7ec8f90aed 100644 --- a/wp-admin/customize.php +++ b/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; ?>