[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 22:51:18 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    |
-------------------------+-----------------------------

Comment (by dd32):

 > But I still can not see how that should apply to $wp_query->comments (I
 didn't get it filled in my test script either, just asking).

 If you tested on a page which might possibly have it set, you'd find it's
 an array of references to arrays.

 For readability, I'd prefer to have the output list separate from the
 input list, rather than just juggling PHP reference's.

 The other thing which this will protect against is a reference to an array
 being passed in to $list, which while deprecated in PHP (Call-time pass-
 by-reference) some developers may still do.

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


More information about the wp-trac mailing list