diff --git src/wp-admin/includes/ajax-actions.php src/wp-admin/includes/ajax-actions.php
index 8764af4..96d1190 100644
|
|
function wp_ajax_add_tag() { |
961 | 961 | $wp_list_table->single_row( $tag ); |
962 | 962 | $parents = ob_get_clean(); |
963 | 963 | |
| 964 | $message = __( 'Item added.' ); |
| 965 | |
| 966 | if( 'category' === $tax->name ) { |
| 967 | $message = __( 'Category added.' ); |
| 968 | } elseif( 'post_tag' === $tax->name ) { |
| 969 | $message = __( 'Tag added.' ); |
| 970 | } |
| 971 | |
964 | 972 | $x->add( |
965 | 973 | array( |
966 | 974 | 'what' => 'taxonomy', |
| 975 | 'data' => $message, |
967 | 976 | 'supplemental' => compact( 'parents', 'noparents' ), |
968 | 977 | ) |
969 | 978 | ); |
diff --git src/wp-includes/js/wp-ajax-response.js src/wp-includes/js/wp-ajax-response.js
index 363a08b..7c6158c 100644
|
|
var wpAjax = jQuery.extend( { |
12 | 12 | return r; |
13 | 13 | }, |
14 | 14 | parseAjaxResponse: function( x, r, e ) { // 1 = good, 0 = strange (bad data?), -1 = you lack permission |
15 | | var parsed = {}, re = jQuery('#' + r).empty(), err = ''; |
| 15 | var parsed = {}, re = jQuery('#' + r).empty(), err = '', successmsg = ''; |
16 | 16 | |
17 | 17 | if ( x && typeof x == 'object' && x.getElementsByTagName('wp_ajax') ) { |
18 | 18 | parsed.responses = []; |
… |
… |
var wpAjax = jQuery.extend( { |
21 | 21 | var th = jQuery(this), child = jQuery(this.firstChild), response; |
22 | 22 | response = { action: th.attr('action'), what: child.get(0).nodeName, id: child.attr('id'), oldId: child.attr('old_id'), position: child.attr('position') }; |
23 | 23 | response.data = jQuery( 'response_data', child ).text(); |
| 24 | successmsg += response.data; |
24 | 25 | response.supplemental = {}; |
25 | 26 | if ( !jQuery( 'supplemental', child ).children().each( function() { |
26 | 27 | response.supplemental[this.nodeName] = jQuery(this).text(); |
… |
… |
var wpAjax = jQuery.extend( { |
40 | 41 | } ).length ) { response.errors = false; } |
41 | 42 | parsed.responses.push( response ); |
42 | 43 | } ); |
43 | | if ( err.length ) { re.html( '<div class="error">' + err + '</div>' ); } |
| 44 | if ( err.length ) { |
| 45 | re.html( '<div class="error">' + err + '</div>' ); |
| 46 | } else { |
| 47 | re.html( '<div class="updated notice is-dismissible"><p>' + successmsg + '</p></div>'); |
| 48 | jQuery(document).trigger( 'wp-updates-notice-added' ); |
| 49 | } |
44 | 50 | return parsed; |
45 | 51 | } |
46 | 52 | if ( isNaN(x) ) { return !re.html('<div class="error"><p>' + x + '</p></div>'); } |