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
This commit is contained in:
Boone Gorges 2015-02-13 16:51:55 +00:00
parent f4d6d4e66b
commit 0efce8c89c
1 changed files with 3 additions and 2 deletions

View File

@ -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 ) {