Make WordPress Core

Changeset 35323


Ignore:
Timestamp:
10/21/2015 08:13:18 AM (8 years ago)
Author:
SergeyBiryukov
Message:

REST API: Change nonce name to _wpnonce.

It's shorter and is compatible with the default name in wp_nonce_field().

Props danielbachhuber.
Fixes #34375.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/rest-api/rest-functions.php

    r35274 r35323  
    576576    $nonce = null;
    577577
    578     if ( isset( $_REQUEST['_wp_rest_nonce'] ) ) {
    579         $nonce = $_REQUEST['_wp_rest_nonce'];
     578    if ( isset( $_REQUEST['_wpnonce'] ) ) {
     579        $nonce = $_REQUEST['_wpnonce'];
    580580    } elseif ( isset( $_SERVER['HTTP_X_WP_NONCE'] ) ) {
    581581        $nonce = $_SERVER['HTTP_X_WP_NONCE'];
Note: See TracChangeset for help on using the changeset viewer.