Make WordPress Core

Changeset 31451


Ignore:
Timestamp:
02/13/2015 04:51:55 PM (10 years ago)
Author:
boonebgorges
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/functions.php

    r31212 r31451  
    31733173 * @param int|string $index_key Optional. Field from the object to use as keys for the new array.
    31743174 *                              Default null.
    3175  * @return array Array of found values. If $index_key is set, an array of found values with keys
    3176  *               corresponding to $index_key.
     3175 * @return array Array of found values. If `$index_key` is set, an array of found values with keys
     3176 *               corresponding to `$index_key`. If `$index_key` is null, array keys from the original
     3177 *               `$list` will be preserved in the results.
    31773178 */
    31783179function wp_list_pluck( $list, $field, $index_key = null ) {
Note: See TracChangeset for help on using the changeset viewer.