Make WordPress Core

Ticket #54955: 54995.2.patch

File 54995.2.patch, 1.2 KB (added by sabernhardt, 4 years ago)

keeping success message on Taxonomy screen but removing extra code from editor screen (custom fields and categories)

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

     
    2727                                var th = jQuery(this), child = jQuery(this.firstChild), response;
    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() {
    3335                                        response.supplemental[this.nodeName] = jQuery(this).text();
     
    5052                        if ( err.length ) {
    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' );
    5658                                wp.a11y.speak( successmsg );