Uses
Uses | Description |
---|---|
wp-includes/functions.php: wp_parse_list() | Cleans up an array, comma- or space-separated list of scalar values. |
Converts an array-like value to an array.
(mixed) (Required) The value being evaluated.
(array) Returns the array extracted from the value.
File: wp-includes/rest-api.php
function rest_sanitize_array( $maybe_array ) { if ( is_scalar( $maybe_array ) ) { return wp_parse_list( $maybe_array ); } if ( ! is_array( $maybe_array ) ) { return array(); } // Normalize to numeric array so nothing unexpected is in the keys. return array_values( $maybe_array ); }
Version | Description |
---|---|
5.5.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/rest_sanitize_array