Opened 9 years ago
#43209 new enhancement
REST API should take settings errors into account
| Reported by: | flixos90 | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Awaiting Review |
| Component: | Options, Meta APIs | Version: | |
| Severity: | normal | Keywords: | 2nd-opinion needs-patch |
| Cc: | Focuses: | rest-api |
Description
The WP_REST_Settings_Controller should notify the client when updating a setting fails due to an invalid value provided per the setting's sanitize_callback (should actually be validation, see related #43208). Currently this goes completely unnoticed.
While update_option() doesn't return any information like that, it may be possible to use the information passed to add_settings_error() in case of a validity issue, and forward that to the client by returning a WP_Error with the message.
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)