REST API: Correctly parse body parameters for DELETE requests.

DELETE was inadvertently omitted from the list of non-POST HTTP methods that should be able to accept body parameters.  Parameters passed to DELETE requests as JSON are already parsed correctly; this commit fixes `application/x-www-form-urlencoded` parameters as well.

Props mnelson4.
Fixes #39933.

Built from https://develop.svn.wordpress.org/trunk@40105


git-svn-id: http://core.svn.wordpress.org/trunk@40042 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
James Nylen 2017-02-23 20:10:44 +00:00
parent 6e9d23220a
commit 7d421b2042
2 changed files with 2 additions and 2 deletions

View File

@ -364,7 +364,7 @@ class WP_REST_Request implements ArrayAccess {
$this->parse_body_params();
}
$accepts_body_data = array( 'POST', 'PUT', 'PATCH' );
$accepts_body_data = array( 'POST', 'PUT', 'PATCH', 'DELETE' );
if ( in_array( $this->method, $accepts_body_data ) ) {
$order[] = 'POST';
}

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.8-alpha-40104';
$wp_version = '4.8-alpha-40105';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.