Changeset 49143
- Timestamp:
- 10/14/2020 02:08:54 AM (4 years ago)
- Location:
- trunk/src
- Files:
-
- 1 deleted
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/functions.php
r49125 r49143 4528 4528 4529 4529 /** 4530 * Accesses an array in depth based on a path of keys. 4531 * 4532 * It is the PHP equivalent of JavaScript's lodash.get, and mirroring it may help other components 4533 * retain some symmetry between client and server implementations. 4534 * 4535 * @since 5.6.0 4536 * 4537 * @param array $array An array from which we want to retrieve some information. 4538 * @param array $path An array of keys describing the path with which to retrieve information. 4539 * @param array $default The return value if the path is not set on the array, 4540 * or if the types of array and path are not arrays. 4541 * @return array An array matching the path specified. 4542 */ 4543 function wp_array_get( $array, $path, $default = array() ) { 4544 // Confirm input values are expected type to avoid notice warnings. 4545 if ( ! is_array( $array ) || ! is_array( $path ) ) { 4546 return $default; 4547 } 4548 4549 $path_length = count( $path ); 4550 4551 for ( $i = 0; $i < $path_length; ++$i ) { 4552 if ( ! isset( $array[ $path[ $i ] ] ) ) { 4553 return $default; 4554 } 4555 $array = $array[ $path[ $i ] ]; 4556 } 4557 4558 return $array; 4559 } 4560 4561 /** 4530 4562 * Filters a list of objects, based on a set of key => value arguments. 4531 4563 * -
trunk/src/wp-settings.php
r49135 r49143 180 180 require ABSPATH . WPINC . '/general-template.php'; 181 181 require ABSPATH . WPINC . '/link-template.php'; 182 require ABSPATH . WPINC . '/array.php';183 182 require ABSPATH . WPINC . '/author-template.php'; 184 183 require ABSPATH . WPINC . '/post.php';
Note: See TracChangeset
for help on using the changeset viewer.