mirror of
https://github.com/WordPress/WordPress.git
synced 2024-09-29 23:57:41 +02:00
General: Move wp_array_get()
next to wp_array_slice_assoc()
, for a bit more consistent placement.
Follow-up to [49135], [49143]. See #51461. Built from https://develop.svn.wordpress.org/trunk@49144 git-svn-id: http://core.svn.wordpress.org/trunk@48906 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
620c069fe8
commit
542d13830b
@ -4499,6 +4499,7 @@ function wp_parse_slug_list( $list ) {
|
|||||||
*/
|
*/
|
||||||
function wp_array_slice_assoc( $array, $keys ) {
|
function wp_array_slice_assoc( $array, $keys ) {
|
||||||
$slice = array();
|
$slice = array();
|
||||||
|
|
||||||
foreach ( $keys as $key ) {
|
foreach ( $keys as $key ) {
|
||||||
if ( isset( $array[ $key ] ) ) {
|
if ( isset( $array[ $key ] ) ) {
|
||||||
$slice[ $key ] = $array[ $key ];
|
$slice[ $key ] = $array[ $key ];
|
||||||
@ -4508,24 +4509,6 @@ function wp_array_slice_assoc( $array, $keys ) {
|
|||||||
return $slice;
|
return $slice;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Determines if the variable is a numeric-indexed array.
|
|
||||||
*
|
|
||||||
* @since 4.4.0
|
|
||||||
*
|
|
||||||
* @param mixed $data Variable to check.
|
|
||||||
* @return bool Whether the variable is a list.
|
|
||||||
*/
|
|
||||||
function wp_is_numeric_array( $data ) {
|
|
||||||
if ( ! is_array( $data ) ) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
$keys = array_keys( $data );
|
|
||||||
$string_keys = array_filter( $keys, 'is_string' );
|
|
||||||
return count( $string_keys ) === 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Accesses an array in depth based on a path of keys.
|
* Accesses an array in depth based on a path of keys.
|
||||||
*
|
*
|
||||||
@ -4558,6 +4541,25 @@ function wp_array_get( $array, $path, $default = array() ) {
|
|||||||
return $array;
|
return $array;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determines if the variable is a numeric-indexed array.
|
||||||
|
*
|
||||||
|
* @since 4.4.0
|
||||||
|
*
|
||||||
|
* @param mixed $data Variable to check.
|
||||||
|
* @return bool Whether the variable is a list.
|
||||||
|
*/
|
||||||
|
function wp_is_numeric_array( $data ) {
|
||||||
|
if ( ! is_array( $data ) ) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$keys = array_keys( $data );
|
||||||
|
$string_keys = array_filter( $keys, 'is_string' );
|
||||||
|
|
||||||
|
return count( $string_keys ) === 0;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Filters a list of objects, based on a set of key => value arguments.
|
* Filters a list of objects, based on a set of key => value arguments.
|
||||||
*
|
*
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '5.6-alpha-49143';
|
$wp_version = '5.6-alpha-49144';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
Loading…
Reference in New Issue
Block a user