### Eclipse Workspace Patch 1.0
#P wordpress-trunk
|
|
|
|
| 3089 | 3089 | * |
| 3090 | 3090 | * @param array $list A list of objects or arrays |
| 3091 | 3091 | * @param int|string $field A field from the object to place instead of the entire object |
| 3092 | | * @return array |
| | 3092 | * @return array All field values of the input list |
| 3093 | 3093 | */ |
| 3094 | 3094 | function wp_list_pluck( $list, $field ) { |
| | 3095 | $fields = array(); |
| 3095 | 3096 | foreach ( $list as $key => $value ) { |
| 3096 | 3097 | $value = (array) $value; |
| 3097 | | $list[ $key ] = $value[ $field ]; |
| | 3098 | $fields[ $key ] = & $value[ $field ]; # preserve possible references |
| 3098 | 3099 | } |
| 3099 | 3100 | |
| 3100 | | return $list; |
| | 3101 | return $fields; |
| 3101 | 3102 | } |
| 3102 | 3103 | |
| 3103 | 3104 | /** |