Make WordPress Core


Ignore:
Timestamp:
12/01/2025 03:01:27 PM (2 months ago)
Author:
SergeyBiryukov
Message:

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].

Reviewed by johnbillion, SergeyBiryukov.
Merges [61324] to the 6.9 branch.

See #41604.

Location:
branches/6.9
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/6.9

  • branches/6.9/src/wp-includes/rest-api/endpoints/class-wp-rest-settings-controller.php

    r60357 r61335  
    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 ) {
Note: See TracChangeset for help on using the changeset viewer.