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.

git-svn-id: https://develop.svn.wordpress.org/trunk@35323 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2015-10-21 08:13:18 +00:00
parent 5bba750579
commit bc2a538b1a
1 changed files with 2 additions and 2 deletions

View File

@ -575,8 +575,8 @@ function rest_cookie_check_errors( $result ) {
// Determine if there is a nonce.
$nonce = null;
if ( isset( $_REQUEST['_wp_rest_nonce'] ) ) {
$nonce = $_REQUEST['_wp_rest_nonce'];
if ( isset( $_REQUEST['_wpnonce'] ) ) {
$nonce = $_REQUEST['_wpnonce'];
} elseif ( isset( $_SERVER['HTTP_X_WP_NONCE'] ) ) {
$nonce = $_SERVER['HTTP_X_WP_NONCE'];
}