Changeset 49144 for trunk/src/wp-includes/functions.php
- Timestamp:
- 10/14/2020 02:14:34 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/functions.php
r49143 r49144 4500 4500 function wp_array_slice_assoc( $array, $keys ) { 4501 4501 $slice = array(); 4502 4502 4503 foreach ( $keys as $key ) { 4503 4504 if ( isset( $array[ $key ] ) ) { … … 4507 4508 4508 4509 return $slice; 4509 }4510 4511 /**4512 * Determines if the variable is a numeric-indexed array.4513 *4514 * @since 4.4.04515 *4516 * @param mixed $data Variable to check.4517 * @return bool Whether the variable is a list.4518 */4519 function wp_is_numeric_array( $data ) {4520 if ( ! is_array( $data ) ) {4521 return false;4522 }4523 4524 $keys = array_keys( $data );4525 $string_keys = array_filter( $keys, 'is_string' );4526 return count( $string_keys ) === 0;4527 4510 } 4528 4511 … … 4557 4540 4558 4541 return $array; 4542 } 4543 4544 /** 4545 * Determines if the variable is a numeric-indexed array. 4546 * 4547 * @since 4.4.0 4548 * 4549 * @param mixed $data Variable to check. 4550 * @return bool Whether the variable is a list. 4551 */ 4552 function wp_is_numeric_array( $data ) { 4553 if ( ! is_array( $data ) ) { 4554 return false; 4555 } 4556 4557 $keys = array_keys( $data ); 4558 $string_keys = array_filter( $keys, 'is_string' ); 4559 4560 return count( $string_keys ) === 0; 4559 4561 } 4560 4562
Note: See TracChangeset
for help on using the changeset viewer.