diff options
author | Joe Dolson <joedolson@git.wordpress.org> | 2022-02-04 01:20:30 +0000 |
---|---|---|
committer | Joe Dolson <joedolson@git.wordpress.org> | 2022-02-04 01:20:30 +0000 |
commit | 26722b77624fc755e3fcb721d2ce530abc777bd6 (patch) | |
tree | 5f6abb7a38ab0d08d909cae0c7ec236c21852c88 /src/js/_enqueues/lib/ajax-response.js | |
parent | 8009f552a245386f0cecaf3e43cf8d73123519ee (diff) | |
download | wordpress-26722b77624fc755e3fcb721d2ce530abc777bd6.tar.gz wordpress-26722b77624fc755e3fcb721d2ce530abc777bd6.zip |
Comments: 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.
Fixes #54955. See #42937.
git-svn-id: https://develop.svn.wordpress.org/trunk@52672 602fd350-edb4-49c9-b593-d223f7449a82
Diffstat (limited to 'src/js/_enqueues/lib/ajax-response.js')
-rw-r--r-- | src/js/_enqueues/lib/ajax-response.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/js/_enqueues/lib/ajax-response.js b/src/js/_enqueues/lib/ajax-response.js index 659b91e023..b764823742 100644 --- a/src/js/_enqueues/lib/ajax-response.js +++ b/src/js/_enqueues/lib/ajax-response.js @@ -27,7 +27,9 @@ window.wpAjax = jQuery.extend( { var th = jQuery(this), child = jQuery(this.firstChild), response; response = { action: th.attr('action'), what: child.get(0).nodeName, id: child.attr('id'), oldId: child.attr('old_id'), position: child.attr('position') }; response.data = jQuery( 'response_data', child ).text(); - successmsg += response.data; + if ( jQuery( 'body' ).hasClass( 'edit-tags-php' ) ) { + successmsg += response.data; + } response.supplemental = {}; if ( !jQuery( 'supplemental', child ).children().each( function() { response.supplemental[this.nodeName] = jQuery(this).text(); @@ -50,7 +52,7 @@ window.wpAjax = jQuery.extend( { if ( err.length ) { re.html( '<div class="error">' + err + '</div>' ); wp.a11y.speak( err ); - } else { + } else if ( successmsg.length ) { re.html( '<div class="updated notice is-dismissible"><p>' + successmsg + '</p></div>'); jQuery(document).trigger( 'wp-updates-notice-added' ); wp.a11y.speak( successmsg ); |