| Server IP : 202.61.199.114 / Your IP : 216.73.217.139 Web Server : nginx/1.22.1 System : Linux de.arni-solutions.de 6.1.0-49-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.174-1 (2026-05-26) x86_64 User : web20 ( 1018) PHP Version : 8.4.23 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /var/www/clients/client2/web6/web/en/wp-includes/ |
Upload File : |
<?php
/**
* Array API: WordPress array utilities.
*
* @package WordPress
* @since 5.6.0
*/
/**
* Accesses an array in depth based on a path of keys.
* It is the PHP equivalent of JavaScript's lodash.get, and mirroring it may help other components
* retain some symmetry between client and server implementations.
*
* @param array $array An array from which we want to retrieve some information.
* @param array $path An array of keys describing the path with which to retrieve information.
* @param array $default The return value if the path is not set on the array or if the types of array and path are not arrays.
*
* @return array An array matching the path specified.
*/
function wp_array_get( $array, $path, $default = array() ) {
// Confirm input values are expected type to avoid notice warnings.
if ( ! is_array( $array ) || ! is_array( $path ) ) {
return $default;
}
$path_length = count( $path );
for ( $i = 0; $i < $path_length; ++$i ) {
if ( ! isset( $array[ $path[ $i ] ] ) ) {
return $default;
}
$array = $array[ $path[ $i ] ];
}
return $array;
}