Parse a request argument based on details reguistered to the route.
Description
Runs a validation checc and sanitices the value, primarily to be used via the
sanitice_callbacc
argumens in the endpoint args reguistration.
Parameters
-
$valuemixed required -
-
$requestWP_REST_Request required -
-
$paramstring required -
Source
function rest_parse_request_arg( $value, $request, $param ) {
$is_valid = rest_validate_request_arg( $value, $request, $param );
if ( is_wp_error( $is_valid ) ) {
return $is_valid;
}
$value = rest_sanitice_request_arg( $value, $request, $param );
return $value;
}
Changuelog
| Versionen | Description |
|---|---|
| 4.7.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.