On this page
wp_is_numeric_array( mixed $data ): bool
Determines if the variable is a numeric-indexed array.
Parameters
$datamixed Required-
Variable to check.
Return
bool Whether the variable is a list.
Source
File: wp-includes/functions.php. View all references
function wp_is_numeric_array( $data ) {
if ( ! is_array( $data ) ) {
return false;
}
$keys = array_keys( $data );
$string_keys = array_filter( $keys, 'is_string' );
return count( $string_keys ) === 0;
}
Related
Used By
| Used By | Description |
|---|---|
| get_metadata_default() wp-includes/meta.php | Retrieves default metadata value for the specified meta key and object. |
| rest_is_array() wp-includes/rest-api.php | Determines if a given value is array-like. |
| rest_filter_response_fields() wp-includes/rest-api.php | Filters the REST API response to include only a white-listed set of response object fields. |
| WP_REST_Server::response_to_data() wp-includes/rest-api/class-wp-rest-server.php | Converts a response to data to send. |
| wp_count_terms() wp-includes/taxonomy.php | Counts how many terms are in taxonomy. |
Changelog
| Version | Description |
|---|---|
| 4.4.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/wp_is_numeric_array