WordPress.org

Make WordPress Core

Changeset 42114


Ignore:
Timestamp:
11/03/2017 05:36:27 PM (21 months ago)
Author:
westonruter
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/js/customize-controls.js

    r42113 r42114  
    82498249        // Set up initial notifications.
    82508250        (function() {
     8251            var removedQueryParams = [];
    82518252
    82528253            /**
     
    83458346            if ( api.settings.changeset.autosaved ) {
    83468347                api.state( 'saved' ).set( false );
    8347                 stripParamsFromLocation( [ 'customize_autosaved' ] ); // Remove param when restoring autosave revision.
    8348             } else if ( ! api.settings.changeset.branching && 'auto-draft' === api.settings.changeset.status ) {
    8349                 stripParamsFromLocation( [ 'changeset_uuid' ] ); // Remove UUID when restoring autosave auto-draft.
     8348                removedQueryParams.push( 'customize_autosaved' );
     8349            }
     8350            if ( ! api.settings.changeset.branching && ( ! api.settings.changeset.status || 'auto-draft' === api.settings.changeset.status ) ) {
     8351                removedQueryParams.push( 'changeset_uuid' ); // Remove UUID when restoring autosave auto-draft.
     8352            }
     8353            if ( removedQueryParams.length > 0 ) {
     8354                stripParamsFromLocation( removedQueryParams );
    83508355            }
    83518356            if ( api.settings.changeset.latestAutoDraftUuid || api.settings.changeset.hasAutosaveRevision ) {
Note: See TracChangeset for help on using the changeset viewer.