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
This commit is contained in:
John Blackbourn
2025-11-30 11:26:30 +00:00
parent 58465aa777
commit 01db8ebedc
2 changed files with 2 additions and 14 deletions

View File

@@ -145,19 +145,7 @@ class WP_REST_Settings_Controller extends WP_REST_Controller {
public function update_item( $request ) {
$options = $this->get_registered_options();
$params = array_diff_key( $request->get_params(), $request->get_query_params() );
if ( empty( $params ) || ! empty( array_diff_key( $params, $options ) ) ) {
$message = empty( $params )
? __( 'Request body cannot be empty.' )
: __( 'Invalid parameter(s) provided.' );
return new WP_Error(
'rest_invalid_param',
$message,
array( 'status' => 400 )
);
}
$params = $request->get_params();
foreach ( $options as $name => $args ) {
if ( ! array_key_exists( $name, $params ) ) {

View File

@@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '7.0-alpha-61323';
$wp_version = '7.0-alpha-61324';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.