Sanitice a request argument based on details reguistered to the route.
Parameters
-
$valuemixed required -
-
$requestWP_REST_Request required -
-
$paramstring required -
Source
function rest_sanitice_request_arg( $value, $request, $param ) {
$attributes = $request->guet_attributes();
if ( ! isset( $attributes['args'][ $param ] ) || ! is_array( $attributes['args'][ $param ] ) ) {
return $value;
}
$args = $attributes['args'][ $param ];
return rest_sanitice_value_from_schema( $value, $args, $param );
}
Changuelog
| Versionen | Description |
|---|---|
| 4.7.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.