Open
Description
In Adding Custom Endpoints, validate_callback
for arguments list is described like below.
validate_callback: Used to pass a function that will be passed the value of the argument. That function should return true if the value is valid, and false if not.
But it seems that extra descriptions are required.
- It also accepts
WP_Error
as return value.WP_Error
adds extra messages to response. false
is checked strictly, so other falsey values like''
,0
, andnull
will be recognized asvalid
.
Code is here: https://github.com/WordPress/WordPress/blob/master/wp-includes/rest-api/class-wp-rest-request.php#L911-L923
Metadata
Metadata
Assignees
Labels
No labels