[wp-trac] [WordPress Trac] #31316: wp_list_pluck unexpectedly returns id indexed array instead of plucked values with index_key = null

WordPress Trac noreply at wordpress.org
Fri Feb 13 01:57:12 UTC 2015


#31316: wp_list_pluck unexpectedly returns id indexed array instead of plucked
values with index_key = null
------------------------------------+------------------------------
 Reporter:  adamsilverstein         |       Owner:
     Type:  defect (bug)            |      Status:  new
 Priority:  normal                  |   Milestone:  Awaiting Review
Component:  General                 |     Version:  3.1
 Severity:  normal                  |  Resolution:
 Keywords:  has-patch dev-feedback  |     Focuses:
------------------------------------+------------------------------

Comment (by adamsilverstein):

 Replying to [comment:3 dd32]:
 > It's worth mentioning here, that altering `wp_list_pluck()` could be out
 of the question based on plugins (or core) expecting this behaviour.
 >
 > It might be better to raise this as a bug in `get_the_terms()` if the
 return values changed.

 Thanks for the feedback, understood we can't go around messing with core
 functions recklessly, however this seems like buggy or at the very least
 unexpected behaviour.


 There is already a ticket for the get_the_terms cache bug,
 (https://core.trac.wordpress.org/ticket/31086).  If we can't change the
 unexpected behaviour, second bet would be to document it so its expected.

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


More information about the wp-trac mailing list