Make WordPress Core

Changeset 49625


Ignore:
Timestamp:
11/17/2020 04:43:33 AM (4 years ago)
Author:
noisysocks
Message:

Customize: Temporary fix for autosave restore notice not being removed

Fixes the "There is a more recent autosave of your changes" notice from not
being removed when the dismiss button is clicked.

The problem is caused by the notice being initialized twice: once by the
common script and then again by the customize-controls script.

This temporary fix prevents customize-controls from initializing a notice if
it has already been initialized.

A better fix would be to not initialize notices twice. This can be done by
removing common as a dependency of updates when deprecateL10nObject is
removed.

When this happens (est: 5.7), this temporary fix should be reverted.

Fixes #51425.
See #51317.
Props karthikbhatb, dlh, SergeyBiryukov.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/js/_enqueues/admin/common.js

    r49151 r49625  
    10951095                $button = $( '<button type="button" class="notice-dismiss"><span class="screen-reader-text"></span></button>' );
    10961096
     1097            if ( $el.find( '.notice-dismiss' ).length ) {
     1098                return;
     1099            }
     1100
    10971101            // Ensure plain text.
    10981102            $button.find( '.screen-reader-text' ).text( __( 'Dismiss this notice.' ) );
Note: See TracChangeset for help on using the changeset viewer.