[wp-trac] [WordPress Trac] #64311: Add filters for input and output validation
WordPress Trac
noreply at wordpress.org
Thu May 21 10:19:13 UTC 2026
#64311: Add filters for input and output validation
-------------------------------------------------+-------------------------
Reporter: priethor | Owner: priethor
Type: enhancement | Status: closed
Priority: normal | Milestone: 7.1
Component: Abilities API | Version: 6.9
Severity: normal | Resolution: fixed
Keywords: has-patch has-unit-tests needs-dev- | Focuses:
note |
-------------------------------------------------+-------------------------
Comment (by gziolo):
In [changeset:"62399" 62399]:
{{{
#!CommitTicketReference repository="" revision="62399"
EST API: Preserve custom status for ability validation errors
he REST run controller for the Abilities API already preserves a custom
HTTP status returned by `wp_ability_normalize_input` filter errors. Apply
the same behavior to validation errors from `wp_ability_validate_input`:
a `WP_Error` is only defaulted to a 400 status when it does not already
include one.
The shared defaulting logic is extracted into a new private
`ensure_error_status()` helper and reused for both normalization and
validation errors.
Follow-up to [62398].
See #64311.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/64311#comment:19>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list