[wp-trac] [WordPress Trac] #35087: Make sure $list in wp_list_pluck() is an array

WordPress Trac noreply at wordpress.org
Tue Dec 15 06:19:47 UTC 2015


#35087: Make sure $list in wp_list_pluck() is an array
--------------------------+------------------------------
 Reporter:  josephscott   |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  General       |     Version:
 Severity:  normal        |  Resolution:
 Keywords:  close         |     Focuses:
--------------------------+------------------------------
Changes (by knutsp):

 * keywords:   => close


Comment:

 When I make this mistake, and I sometimes do, of calling the very handy
 `wp_list_pluck()` with a variable that in some cases may not be an array,
 I would certainly prefer to see a warning indicating my mistake, instead
 of just silently see, or miss, an empty result array. And which may make
 me think there was no data and start looking for them, instead of fixing
 my code.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/35087#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list