[wp-trac] [WordPress Trac] #35028: WP_Error objects returned by REST API validation callbacks aren't formatted correctly
WordPress Trac
noreply at wordpress.org
Sat Dec 12 18:22:05 UTC 2015
#35028: WP_Error objects returned by REST API validation callbacks aren't formatted
correctly
----------------------------------------+------------------------------
Reporter: bradyvercher | Owner: joehoyle
Type: defect (bug) | Status: closed
Priority: normal | Milestone: Awaiting Review
Component: REST API | Version: 4.4
Severity: normal | Resolution: fixed
Keywords: has-patch needs-unit-tests | Focuses:
----------------------------------------+------------------------------
Changes (by joehoyle):
* owner: => joehoyle
* status: new => closed
* resolution: => fixed
Comment:
In [changeset:"35890"]:
{{{
#!CommitTicketReference repository="" revision="35890"
REST API: Improve formatting of failed validation errors.
If a validation_callback returns a WP_Error it should give the same
response format as if it returned `false`. This makes programmatically
reading the validation errors better.
Props bradyvercher for initial patch.
Fixes #35028.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/35028#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list