[wp-trac] [WordPress Trac] #38777: Add method to merge one WP_Error into another

WordPress Trac noreply at wordpress.org
Thu Oct 1 19:20:17 UTC 2020


#38777: Add method to merge one WP_Error into another
--------------------------------------+-----------------------
 Reporter:  rmccue                    |       Owner:  dlh
     Type:  feature request           |      Status:  assigned
 Priority:  normal                    |   Milestone:  5.6
Component:  General                   |     Version:
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:  rest-api
--------------------------------------+-----------------------

Comment (by TimothyBlynJacobs):

 Replying to [comment:20 johnbillion]:
 > Are there instances in the REST API where this would be useful right
 away?

 Yeah, we have an issue with how we handle errors returned from
 `validate_callback` and `sanitize_callback` in
 `WP_REST_Request::has_valid_params` and `::sanitize_params()`. We only
 grab the first error message as a string.

 But ideally, we'd combine all of those errors into one error object.

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


More information about the wp-trac mailing list