Parse a request argument based on details registered to the route.
Description
Runs a validation check and sanitizes the value, primarily to be used via the sanitize_callback
arguments in the endpoint args registration.
Parameters
$value
mixedrequired$request
WP_REST_Requestrequired$param
stringrequired
Source
* @since 4.7.0
*
* @param mixed $value
* @param WP_REST_Request $request
* @param string $param
* @return mixed
*/
function rest_parse_request_arg( $value, $request, $param ) {
$is_valid = rest_validate_request_arg( $value, $request, $param );
if ( is_wp_error( $is_valid ) ) {
Changelog
Version | Description |
---|---|
4.7.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.