Skip to content

Commit 01db8eb

Browse files
committed
Options, Meta APIs: Revert additional request validity handling that was added to the /wp/v2/settings REST API route. This change needs more work to account for URL query parameters used in place of body data.
This reverts [60357] and [60301]. See #41604 Built from https://develop.svn.wordpress.org/trunk@61324 git-svn-id: http://core.svn.wordpress.org/trunk@60636 1a063a9b-81f0-0310-95a4-ce76da25c4cd
1 parent 58465aa commit 01db8eb

2 files changed

Lines changed: 2 additions & 14 deletions

File tree

wp-includes/rest-api/endpoints/class-wp-rest-settings-controller.php

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -145,19 +145,7 @@ protected function prepare_value( $value, $schema ) {
145145
public function update_item( $request ) {
146146
$options = $this->get_registered_options();
147147

148-
$params = array_diff_key( $request->get_params(), $request->get_query_params() );
149-
150-
if ( empty( $params ) || ! empty( array_diff_key( $params, $options ) ) ) {
151-
$message = empty( $params )
152-
? __( 'Request body cannot be empty.' )
153-
: __( 'Invalid parameter(s) provided.' );
154-
155-
return new WP_Error(
156-
'rest_invalid_param',
157-
$message,
158-
array( 'status' => 400 )
159-
);
160-
}
148+
$params = $request->get_params();
161149

162150
foreach ( $options as $name => $args ) {
163151
if ( ! array_key_exists( $name, $params ) ) {

wp-includes/version.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
* @global string $wp_version
1818
*/
19-
$wp_version = '7.0-alpha-61323';
19+
$wp_version = '7.0-alpha-61324';
2020

2121
/**
2222
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.

0 commit comments

Comments
 (0)