mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-18 21:41:42 +01:00
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:
parent
6e9d23220a
commit
7d421b2042
@ -364,7 +364,7 @@ class WP_REST_Request implements ArrayAccess {
|
|||||||
$this->parse_body_params();
|
$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 ) ) {
|
if ( in_array( $this->method, $accepts_body_data ) ) {
|
||||||
$order[] = 'POST';
|
$order[] = 'POST';
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @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.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
Loading…
Reference in New Issue
Block a user