Changeset 52169
- Timestamp:
- 11/15/2021 10:16:32 PM (3 years ago)
- Location:
- trunk
- Files:
-
- 1 deleted
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/js/_enqueues/lib/ajax-response.js
r52168 r52169 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 = '' , successmsg = '';21 var parsed = {}, re = jQuery('#' + r).empty(), err = ''; 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;31 30 response.supplemental = {}; 32 31 if ( !jQuery( 'supplemental', child ).children().each( function() { … … 48 47 parsed.responses.push( response ); 49 48 } ); 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 } 49 if ( err.length ) { re.html( '<div class="error">' + err + '</div>' ); } 58 50 return parsed; 59 51 } -
trunk/src/wp-admin/includes/ajax-actions.php
r52168 r52169 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 1114 1105 $x->add( 1115 1106 array( 1116 1107 'what' => 'taxonomy', 1117 'data' => $message,1118 1108 'supplemental' => compact( 'parents', 'noparents' ), 1119 1109 )
Note: See TracChangeset
for help on using the changeset viewer.