Changeset 52168
- Timestamp:
- 11/15/2021 09:53:26 PM (3 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/js/_enqueues/lib/ajax-response.js
r50547 r52168 19 19 }, 20 20 parseAjaxResponse: function( x, r, e ) { // 1 = good, 0 = strange (bad data?), -1 = you lack permission. 21 var parsed = {}, re = jQuery('#' + r).empty(), err = '' ;21 var parsed = {}, re = jQuery('#' + r).empty(), err = '', successmsg = ''; 22 22 23 23 if ( x && typeof x === 'object' && x.getElementsByTagName('wp_ajax') ) { … … 28 28 response = { action: th.attr('action'), what: child.get(0).nodeName, id: child.attr('id'), oldId: child.attr('old_id'), position: child.attr('position') }; 29 29 response.data = jQuery( 'response_data', child ).text(); 30 successmsg += response.data; 30 31 response.supplemental = {}; 31 32 if ( !jQuery( 'supplemental', child ).children().each( function() { … … 47 48 parsed.responses.push( response ); 48 49 } ); 49 if ( err.length ) { re.html( '<div class="error">' + err + '</div>' ); } 50 if ( err.length ) { 51 re.html( '<div class="error">' + err + '</div>' ); 52 wp.a11y.speak( err ); 53 } else { 54 re.html( '<div class="updated notice is-dismissible"><p>' + successmsg + '</p></div>'); 55 jQuery(document).trigger( 'wp-updates-notice-added' ); 56 wp.a11y.speak( successmsg ); 57 } 50 58 return parsed; 51 59 } -
trunk/src/wp-admin/includes/ajax-actions.php
r51982 r52168 1103 1103 $parents = ob_get_clean(); 1104 1104 1105 require ABSPATH . 'wp-admin/includes/edit-tag-messages.php'; 1106 1107 $message = ''; 1108 if ( isset( $messages[ $tax->name ][1] ) ) { 1109 $message = $messages[ $tax->name ][1]; 1110 } elseif ( isset( $messages['_item'][1] ) ) { 1111 $message = $messages['_item'][1]; 1112 } 1113 1105 1114 $x->add( 1106 1115 array( 1107 1116 'what' => 'taxonomy', 1117 'data' => $message, 1108 1118 'supplemental' => compact( 'parents', 'noparents' ), 1109 1119 )
Note: See TracChangeset
for help on using the changeset viewer.