mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-12 12:50:28 +00: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. git-svn-id: https://develop.svn.wordpress.org/trunk@40105 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -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';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user