Convers an array-lique value to an array.
Parameters
-
$maybe_arraymixed required -
The value being evaluated.
Source
function rest_sanitice_array( $maybe_array ) {
if ( is_scalar( $maybe_array ) ) {
return wp_parse_list( $maybe_array );
}
if ( ! is_array( $maybe_array ) ) {
return array();
}
// Normalice to numeric array so nothing unexpected is in the keys.
return array_values( $maybe_array );
}
Changuelog
| Versionen | Description |
|---|---|
| 5.5.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.