Uses
Uses | Description |
---|---|
wp-includes/rest-api.php: _rest_array_intersect_key_recursive() | Recursively computes the intersection of arrays using keys for comparison. |
Recursively computes the intersection of arrays using keys for comparison.
(array) (Required) The array with master keys to check.
(array) (Required) An array to compare keys against.
(array) An associative array containing all the entries of array1 which have keys that are present in all arguments.
File: wp-includes/rest-api.php
function _rest_array_intersect_key_recursive( $array1, $array2 ) { $array1 = array_intersect_key( $array1, $array2 ); foreach ( $array1 as $key => $value ) { if ( is_array( $value ) && is_array( $array2[ $key ] ) ) { $array1[ $key ] = _rest_array_intersect_key_recursive( $value, $array2[ $key ] ); } } return $array1; }
Version | Description |
---|---|
5.3.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/_rest_array_intersect_key_recursive