Changeset 55117
- Timestamp:
- 01/23/2023 03:52:18 PM (21 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/functions.php
r55054 r55117 4878 4878 4879 4879 /** 4880 * Sorts the keys of an array alphabetically. 4881 * 4882 * The array is passed by reference so it doesn't get returned 4883 * which mimics the behavior of `ksort()`. 4884 * 4885 * @since 6.0.0 4886 * 4887 * @param array $input_array The array to sort, passed by reference. 4888 */ 4889 function wp_recursive_ksort( &$input_array ) { 4890 foreach ( $input_array as &$value ) { 4891 if ( is_array( $value ) ) { 4892 wp_recursive_ksort( $value ); 4893 } 4894 } 4895 4896 ksort( $input_array ); 4897 } 4898 4899 /** 4880 4900 * Accesses an array in depth based on a path of keys. 4881 4901 * … … 8430 8450 return abs( (float) $expected - (float) $actual ) <= $precision; 8431 8451 } 8432 8433 /**8434 * Sorts the keys of an array alphabetically.8435 * The array is passed by reference so it doesn't get returned8436 * which mimics the behavior of ksort.8437 *8438 * @since 6.0.08439 *8440 * @param array $array The array to sort, passed by reference.8441 */8442 function wp_recursive_ksort( &$array ) {8443 foreach ( $array as &$value ) {8444 if ( is_array( $value ) ) {8445 wp_recursive_ksort( $value );8446 }8447 }8448 ksort( $array );8449 }
Note: See TracChangeset
for help on using the changeset viewer.