[wp-trac] [WordPress Trac] #16895: wp_list_pluck cannot be used with arrays of references

WordPress Trac wp-trac at lists.automattic.com
Sat Mar 19 15:32:01 UTC 2011


#16895: wp_list_pluck cannot be used with arrays of references
-----------------------------------------+-----------------------------
 Reporter:  dd32                         |       Owner:
     Type:  enhancement                  |      Status:  new
 Priority:  normal                       |   Milestone:  Future Release
Component:  General                      |     Version:  3.1
 Severity:  normal                       |  Resolution:
 Keywords:  has-patch reporter-feedback  |
-----------------------------------------+-----------------------------
Changes (by hakre):

 * keywords:  has-patch => has-patch reporter-feedback
 * type:  defect (bug) => enhancement


Comment:

 The function states that it the $list parameter is an array that contains
 arrays or objects:

 {{{
 /**
  * Pluck a certain field out of each object in a list
  *
  * @since 3.1.0
  *
  * @param array $list A list of objects or arrays
  * @param int|string $field A field from the object to place instead of
 the entire object
  * @return array
  */
 function wp_list_pluck( $list, $field ) {
 }}}

 It does not state that it operates on an array that contains referecens to
 other arrays.

 As well as it doesn't state that it operates on an array that contains
 references to other objects.

 That's not what it has been made fore. So why do you expect it to be
 working with references?

 And if it is expected to be working with references, shouldn't it return
 references then?

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/16895#comment:2>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list