Customize: Use changeset-specific "locked" messages when branching is enabled.

Props dlh.
See #39896.
Fixes #42655.

Built from https://develop.svn.wordpress.org/trunk@42538


git-svn-id: http://core.svn.wordpress.org/trunk@42367 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Weston Ruter 2018-01-22 06:28:31 +00:00
parent cd9f48b54f
commit 87cae6e261
2 changed files with 19 additions and 5 deletions

View File

@ -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 ) { #>
<?php
/* translators: %s: User who is customizing the changeset in customizer. */
printf( __( '%s is already customizing this site. Do you want to take over?' ), '{{ data.lockUser.name }}' );
echo esc_html( sprintf( $l10n['locked_allow_override'], '{{ data.lockUser.name }}' ) );
?>
<# } else { #>
<?php
/* translators: %s: User who is customizing the changeset in customizer. */
printf( __( '%s is already customizing this site. Please wait until they are done to try customizing. Your latest changes have been autosaved.' ), '{{ data.lockUser.name }}' );
echo esc_html( sprintf( $l10n['locked'], '{{ data.lockUser.name }}' ) );
?>
<# } #>
</p>

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.0-alpha-42536';
$wp_version = '5.0-alpha-42538';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.