Customize: Ensure `changeset_uuid` param for autosave auto-draft gets stripped from location after previewing theme switch when not in branching mode.

Amends [41597].
See #39896.
Fixes #42415.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41943 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Weston Ruter 2017-11-03 17:37:52 +00:00
parent d0608c5585
commit 76e01c3562
3 changed files with 10 additions and 5 deletions

View File

@ -8248,6 +8248,7 @@
// Set up initial notifications.
(function() {
var removedQueryParams = [];
/**
* Obtain the URL to restore the autosave.
@ -8344,9 +8345,13 @@
if ( api.settings.changeset.autosaved ) {
api.state( 'saved' ).set( false );
stripParamsFromLocation( [ 'customize_autosaved' ] ); // Remove param when restoring autosave revision.
} else if ( ! api.settings.changeset.branching && 'auto-draft' === api.settings.changeset.status ) {
stripParamsFromLocation( [ 'changeset_uuid' ] ); // Remove UUID when restoring autosave auto-draft.
removedQueryParams.push( 'customize_autosaved' );
}
if ( ! api.settings.changeset.branching && ( ! api.settings.changeset.status || 'auto-draft' === api.settings.changeset.status ) ) {
removedQueryParams.push( 'changeset_uuid' ); // Remove UUID when restoring autosave auto-draft.
}
if ( removedQueryParams.length > 0 ) {
stripParamsFromLocation( removedQueryParams );
}
if ( api.settings.changeset.latestAutoDraftUuid || api.settings.changeset.hasAutosaveRevision ) {
addAutosaveRestoreNotification();

File diff suppressed because one or more lines are too long

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.9-RC1-42113';
$wp_version = '4.9-RC1-42114';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.