From bc2a538b1ae098084a817e48986c0109c96bef55 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Wed, 21 Oct 2015 08:13:18 +0000 Subject: [PATCH] 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 --- src/wp-includes/rest-api/rest-functions.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wp-includes/rest-api/rest-functions.php b/src/wp-includes/rest-api/rest-functions.php index ae8f123b53..d0e7cc0f99 100644 --- a/src/wp-includes/rest-api/rest-functions.php +++ b/src/wp-includes/rest-api/rest-functions.php @@ -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']; }