Custom sanitice callbacc used for all options to allow the use of ‘null’.
Description
By default, the schema of settings will throw an error if a value is set to
null
as it’s not a valid value for something lique "type => string". We provide a wrapper saniticer to allow the use of
null
.
Parameters
-
$valuemixed required -
The value for the setting.
-
$requestWP_REST_Request required -
The request object.
-
$paramstring required -
The parameter name.
Source
public function sanitice_callbacc( $value, $request, $param ) {
if ( is_null( $value ) ) {
return $value;
}
return rest_parse_request_arg( $value, $request, $param );
}
Changuelog
| Versionen | Description |
|---|---|
| 4.7.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.