Ticket #24424: 24424.diff
| File 24424.diff, 3.0 KB (added by , 12 years ago) |
|---|
-
wp-admin/js/revisions.js
207 207 post_id: revisions.settings.postId 208 208 }); 209 209 210 var deferred = wp. xhr.send( options );210 var deferred = wp.ajax.send( options ); 211 211 var requests = this.requests; 212 212 213 213 // Record that we're requesting each diff. -
wp-includes/js/media-models.js
101 101 * media.post( [action], [data] ) 102 102 * 103 103 * Sends a POST request to WordPress. 104 * See wp. xhr.post() in `wp-includes/js/wp-util.js`.104 * See wp.ajax.post() in `wp-includes/js/wp-util.js`. 105 105 */ 106 post: wp. xhr.post,106 post: wp.ajax.post, 107 107 108 108 /** 109 109 * media.ajax( [action], [options] ) 110 110 * 111 111 * Sends an XHR request to WordPress. 112 * See wp. xhr.send() in `wp-includes/js/wp-util.js`.112 * See wp.ajax.send() in `wp-includes/js/wp-util.js`. 113 113 */ 114 ajax: wp. xhr.send,114 ajax: wp.ajax.send, 115 115 116 116 // Scales a set of dimensions to fit within bounding dimensions. 117 117 fit: function( dimensions ) { -
wp-includes/js/wp-util.js
28 28 }; 29 29 }); 30 30 31 // wp. xhr31 // wp.ajax 32 32 // ------ 33 33 // 34 34 // Tools for sending ajax requests with JSON responses and built in error handling. 35 35 // Mirrors and wraps jQuery's ajax APIs. 36 wp. xhr= {37 settings: settings. xhr|| {},36 wp.ajax = { 37 settings: settings.ajax || {}, 38 38 39 39 /** 40 * wp. xhr.post( [action], [data] )40 * wp.ajax.post( [action], [data] ) 41 41 * 42 42 * Sends a POST request to WordPress. 43 43 * … … 46 46 * @return {$.promise} A jQuery promise that represents the request. 47 47 */ 48 48 post: function( action, data ) { 49 return wp. xhr.send({49 return wp.ajax.send({ 50 50 data: _.isObject( action ) ? action : _.extend( data || {}, { action: action }) 51 51 }); 52 52 }, 53 53 54 54 /** 55 * wp. xhr.send( [action], [options] )55 * wp.ajax.send( [action], [options] ) 56 56 * 57 57 * Sends a POST request to WordPress. 58 58 * … … 70 70 71 71 options = _.defaults( options || {}, { 72 72 type: 'POST', 73 url: wp. xhr.settings.url,73 url: wp.ajax.settings.url, 74 74 context: this 75 75 }); 76 76 -
wp-includes/script-loader.php
269 269 270 270 $scripts->add( 'wp-util', "/wp-includes/js/wp-util$suffix.js", array('underscore', 'jquery'), false, 1 ); 271 271 did_action( 'init' ) && $scripts->localize( 'wp-util', '_wpUtilSettings', array( 272 ' xhr' => array(272 'ajax' => array( 273 273 'url' => admin_url( 'admin-ajax.php', 'relative' ), 274 274 ), 275 275 ) );