From b5b05c51c694fa1042965f5ae12078ccc4c05d39 Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Mon, 22 Jan 2018 06:27:41 +0000 Subject: [PATCH] Customize: Use changeset-specific "locked" messages when branching is enabled. Props dlh. See #39896. Fixes #42655. git-svn-id: https://develop.svn.wordpress.org/trunk@42538 602fd350-edb4-49c9-b593-d223f7449a82 --- .../class-wp-customize-manager.php | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/src/wp-includes/class-wp-customize-manager.php b/src/wp-includes/class-wp-customize-manager.php index c453fc0841..a95085e109 100644 --- a/src/wp-includes/class-wp-customize-manager.php +++ b/src/wp-includes/class-wp-customize-manager.php @@ -3986,6 +3986,22 @@ final class WP_Customize_Manager { * @since 4.1.0 */ public function render_control_templates() { + if ( $this->branching() ) { + $l10n = array( + /* translators: %s: User who is customizing the changeset in customizer. */ + 'locked' => __( '%s is already customizing this changeset. Please wait until they are done to try customizing. Your latest changes have been autosaved.' ), + /* translators: %s: User who is customizing the changeset in customizer. */ + 'locked_allow_override' => __( '%s is already customizing this changeset. Do you want to take over?' ), + ); + } else { + $l10n = array( + /* translators: %s: User who is customizing the changeset in customizer. */ + 'locked' => __( '%s is already customizing this site. Please wait until they are done to try customizing. Your latest changes have been autosaved.' ), + /* translators: %s: User who is customizing the changeset in customizer. */ + 'locked_allow_override' => __( '%s is already customizing this site. Do you want to take over?' ), + ); + } + foreach ( $this->registered_control_types as $control_type ) { $control = new $control_type( $this, 'temp', array( @@ -4150,13 +4166,11 @@ final class WP_Customize_Manager { {{{ data.message }}} <# } else if ( data.allowOverride ) { #> <# } else { #> <# } #>