[wp-trac] [WordPress Trac] #41604: REST API: Attempting to create or update a non-existent setting doesn't return an error response

WordPress Trac noreply at wordpress.org
Sun Nov 30 11:02:23 UTC 2025


#41604: REST API: Attempting to create or update a non-existent setting doesn't
return an error response
------------------------------------------+--------------------------
 Reporter:  johnbillion                   |       Owner:  johnbillion
     Type:  defect (bug)                  |      Status:  reopened
 Priority:  normal                        |   Milestone:  6.9
Component:  Options, Meta APIs            |     Version:
 Severity:  normal                        |  Resolution:
 Keywords:  needs-patch needs-unit-tests  |     Focuses:  rest-api
------------------------------------------+--------------------------

Comment (by johnbillion):

 I'm going to revert this for 6.9 as we don't have a patch for handling
 settings value updates via URL query parameters instead of body data.

 This appears to be an oddity of the WP REST API that wasn't considered.
 `WP_REST_Request::get_params()` reads parameter values from both body data
 and URL query parameters, meaning the latter can be used in place of the
 former. So while updating data via a POST but passing data in via URL
 query parameters does seem strange, it's fully supported. This change
 needs to account for that usage.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/41604#comment:35>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list