From 0efce8c89ca4949f7b9364886739a52e41cb0aca Mon Sep 17 00:00:00 2001 From: Boone Gorges Date: Fri, 13 Feb 2015 16:51:55 +0000 Subject: [PATCH] Improve documentation for return value of `wp_list_pluck()`. `wp_list_pluck()` will preserve the original array keys if no `$index_key` parameter is provided. This changeset updates the documentation accordingly. Props adamsilverstein. Fixes #31316. git-svn-id: https://develop.svn.wordpress.org/trunk@31451 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/functions.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/wp-includes/functions.php b/src/wp-includes/functions.php index b5327ed788..0050d10b7c 100644 --- a/src/wp-includes/functions.php +++ b/src/wp-includes/functions.php @@ -3172,8 +3172,9 @@ function wp_list_filter( $list, $args = array(), $operator = 'AND' ) { * @param int|string $field Field from the object to place instead of the entire object * @param int|string $index_key Optional. Field from the object to use as keys for the new array. * Default null. - * @return array Array of found values. If $index_key is set, an array of found values with keys - * corresponding to $index_key. + * @return array Array of found values. If `$index_key` is set, an array of found values with keys + * corresponding to `$index_key`. If `$index_key` is null, array keys from the original + * `$list` will be preserved in the results. */ function wp_list_pluck( $list, $field, $index_key = null ) { if ( ! $index_key ) {