[wp-trac] [WordPress Trac] #43209: REST API should take settings errors into account

WordPress Trac noreply at wordpress.org
Thu Feb 1 23:59:12 UTC 2018


#43209: REST API should take settings errors into account
--------------------------------+-------------------------------------
 Reporter:  flixos90            |      Owner:
     Type:  enhancement         |     Status:  new
 Priority:  normal              |  Milestone:  Awaiting Review
Component:  Options, Meta APIs  |    Version:
 Severity:  normal              |   Keywords:  2nd-opinion needs-patch
  Focuses:  rest-api            |
--------------------------------+-------------------------------------
 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.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/43209>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list