Make WordPress Core

Changeset 52728 for branches/5.9


Ignore:
Timestamp:
02/15/2022 02:43:24 AM (2 years ago)
Author:
peterwilsoncc
Message:

Editor: Only render term update notices on term screens.

Prevent blank notices from appearing when adding custom fields or terms in the post editor.

Props gadhiyaravi, Boniu91, ravipatel, sabernhardt, joedolson.
Fixes #54955. See #42937.

Location:
branches/5.9
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.9

  • branches/5.9/src/js/_enqueues/lib/ajax-response.js

    r52170 r52728  
    2828                response = { action: th.attr('action'), what: child.get(0).nodeName, id: child.attr('id'), oldId: child.attr('old_id'), position: child.attr('position') };
    2929                response.data = jQuery( 'response_data', child ).text();
    30                 successmsg += response.data;
     30                if ( jQuery( 'body' ).hasClass( 'edit-tags-php' ) ) {
     31                    successmsg += response.data;
     32                }
    3133                response.supplemental = {};
    3234                if ( !jQuery( 'supplemental', child ).children().each( function() {
     
    5153                re.html( '<div class="error">' + err + '</div>' );
    5254                wp.a11y.speak( err );
    53             } else {
     55            } else if ( successmsg.length ) {
    5456                re.html( '<div class="updated notice is-dismissible"><p>' + successmsg + '</p></div>');
    5557                jQuery(document).trigger( 'wp-updates-notice-added' );
Note: See TracChangeset for help on using the changeset viewer.