WordPress.org

Make WordPress Core

Changeset 24652


Ignore:
Timestamp:
07/11/13 00:20:36 (9 months ago)
Author:
nacin
Message:

Rename wp.xhr to wp.ajax to match admin-ajax.php (which it uses), jQuery.ajax (which it wraps), etc. see #24424.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/js/revisions.js

    r24646 r24652  
    208208                }); 
    209209 
    210                 var deferred = wp.xhr.send( options ); 
     210                var deferred = wp.ajax.send( options ); 
    211211                var requests = this.requests; 
    212212 
  • trunk/wp-includes/js/media-models.js

    r24369 r24652  
    102102         * 
    103103         * 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`. 
    105105         */ 
    106         post: wp.xhr.post, 
     106        post: wp.ajax.post, 
    107107 
    108108        /** 
     
    110110         * 
    111111         * 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`. 
    113113         */ 
    114         ajax: wp.xhr.send, 
     114        ajax: wp.ajax.send, 
    115115 
    116116        // Scales a set of dimensions to fit within bounding dimensions. 
  • trunk/wp-includes/js/wp-util.js

    r24369 r24652  
    2929    }); 
    3030 
    31     // wp.xhr 
     31    // wp.ajax 
    3232    // ------ 
    3333    // 
    3434    // Tools for sending ajax requests with JSON responses and built in error handling. 
    3535    // Mirrors and wraps jQuery's ajax APIs. 
    36     wp.xhr = { 
    37         settings: settings.xhr || {}, 
     36    wp.ajax = { 
     37        settings: settings.ajax || {}, 
    3838 
    3939        /** 
    40          * wp.xhr.post( [action], [data] ) 
     40         * wp.ajax.post( [action], [data] ) 
    4141         * 
    4242         * Sends a POST request to WordPress. 
     
    4747         */ 
    4848        post: function( action, data ) { 
    49             return wp.xhr.send({ 
     49            return wp.ajax.send({ 
    5050                data: _.isObject( action ) ? action : _.extend( data || {}, { action: action }) 
    5151            }); 
     
    5353 
    5454        /** 
    55          * wp.xhr.send( [action], [options] ) 
     55         * wp.ajax.send( [action], [options] ) 
    5656         * 
    5757         * Sends a POST request to WordPress. 
     
    7171            options = _.defaults( options || {}, { 
    7272                type:    'POST', 
    73                 url:     wp.xhr.settings.url, 
     73                url:     wp.ajax.settings.url, 
    7474                context: this 
    7575            }); 
  • trunk/wp-includes/script-loader.php

    r24578 r24652  
    270270    $scripts->add( 'wp-util', "/wp-includes/js/wp-util$suffix.js", array('underscore', 'jquery'), false, 1 ); 
    271271    did_action( 'init' ) && $scripts->localize( 'wp-util', '_wpUtilSettings', array( 
    272         'xhr' => array( 
     272        'ajax' => array( 
    273273            'url' => admin_url( 'admin-ajax.php', 'relative' ), 
    274274        ), 
Note: See TracChangeset for help on using the changeset viewer.