On this page
rest_is_array( mixed $maybe_array ): bool
Determines if a given value is array-like.
Parameters
$maybe_arraymixed Required-
The value being evaluated.
Return
bool
Source
File: wp-includes/rest-api.php. View all references
function rest_is_array( $maybe_array ) {
if ( is_scalar( $maybe_array ) ) {
$maybe_array = wp_parse_list( $maybe_array );
}
return wp_is_numeric_array( $maybe_array );
}
Related
Uses
| Uses | Description |
|---|---|
| wp_parse_list() wp-includes/functions.php | Converts a comma- or space-separated list of scalar values to an array. |
| wp_is_numeric_array() wp-includes/functions.php | Determines if the variable is a numeric-indexed array. |
Used By
| Used By | Description |
|---|---|
| WP_REST_Posts_Controller::prepare_tax_query() wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php | Prepares the ‘tax_query’ for a collection of posts. |
| rest_validate_array_value_from_schema() wp-includes/rest-api.php | Validates an array value based on a schema. |
| rest_filter_response_by_context() wp-includes/rest-api.php | Filters the response to remove any fields not available in the given context. |
Changelog
| Version | Description |
|---|---|
| 5.5.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/rest_is_array