Abstract_REST_Endpoint::sanitize_callback( mixed $value )
Sanitize a request argument based on details registered to the route.
Contents
Parameters
- $value
-
(mixed) (Required) Value of the 'filter' argument.
Return
(string|array)
Source
File: src/Tickets/Commerce/Gateways/Contracts/Abstract_REST_Endpoint.php
public function sanitize_callback( $value ) {
if ( is_array( $value ) ) {
return array_map( 'sanitize_text_field', $value );
}
return sanitize_text_field( $value );
}
Changelog
| Version | Description |
|---|---|
| 5.3.0 | moved to Abstract_REST_Endpoint |
| 5.1.9 | Introduced. |