WordPress.org

Make WordPress Core


Ignore:
Timestamp:
08/02/2017 04:44:05 PM (4 years ago)
Author:
jnylen0
Message:

REST API: Allow overriding jQuery.ajax calls from within wp-admin

There are now 3 places where we call out to the REST API from within wp-admin. This commit introduces a small library to allow overriding these calls, centralize nonce-passing logic, and eliminate the need to pass a full REST URL down to client code (this last feature is not yet used and will be explored in a separate ticket).

Fixes #40919.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/media.php

    r41198 r41206  
    34383438        'nonce'     => array(
    34393439            'sendToEditor' => wp_create_nonce( 'media-send-to-editor' ),
    3440             'wpRestApi'    => wp_create_nonce( 'wp_rest' ),
    34413440        ),
    34423441        'post'    => array(
Note: See TracChangeset for help on using the changeset viewer.