diff --git a/wp-includes/rest-api/class-wp-rest-request.php b/wp-includes/rest-api/class-wp-rest-request.php index 0a26d0fe3d..e41c014557 100644 --- a/wp-includes/rest-api/class-wp-rest-request.php +++ b/wp-includes/rest-api/class-wp-rest-request.php @@ -354,7 +354,11 @@ class WP_REST_Request implements ArrayAccess { */ protected function get_parameter_order() { $order = array(); - $order[] = 'JSON'; + + $content_type = $this->get_content_type(); + if ( $content_type['value'] === 'application/json' ) { + $order[] = 'JSON'; + } $this->parse_json_params(); @@ -424,15 +428,8 @@ class WP_REST_Request implements ArrayAccess { * @param mixed $value Parameter value. */ public function set_param( $key, $value ) { - switch ( $this->method ) { - case 'POST': - $this->params['POST'][ $key ] = $value; - break; - - default: - $this->params['GET'][ $key ] = $value; - break; - } + $order = $this->get_parameter_order(); + $this->params[ $order[0] ][ $key ] = $value; } /** diff --git a/wp-includes/version.php b/wp-includes/version.php index 75970d22bd..deae2e3261 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.8-beta1-40814'; +$wp_version = '4.8-beta1-40815'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.