[wp-trac] [WordPress Trac] #54751: Invalid argument in class-wp-list-util.php

WordPress Trac noreply at wordpress.org
Wed Apr 6 22:51:47 UTC 2022


#54751: Invalid argument in class-wp-list-util.php
-------------------------------------------------+-------------------------
 Reporter:  marv2                                |       Owner:
                                                 |  peterwilsoncc
     Type:  defect (bug)                         |      Status:  closed
 Priority:  normal                               |   Milestone:  6.0
Component:  General                              |     Version:  3.1
 Severity:  normal                               |  Resolution:  fixed
 Keywords:  good-first-bug has-patch has-unit-   |     Focuses:
  tests                                          |
-------------------------------------------------+-------------------------

Comment (by peterwilsoncc):

 @RMarks I'm unable to reproduce this on the trunk branch that includes
 this fix. The function returns an empty array, I tried various
 combinations:

 {{{
 wp> wp_list_pluck( [], 'bob' );
 => :
 array(0) {
 }
  wp_list_pluck( [[],[],[]], 'bob' );
 => :
 array(3) {
   [0] =>
   NULL
   [1] =>
   NULL
   [2] =>
   NULL
 }
 wp> wp_list_pluck( [(object)[],(object)[],(object)[]], 'bob' );
 => :
 array(3) {
   [0] =>
   NULL
   [1] =>
   NULL
   [2] =>
   NULL
 }
 }}}

 If you're able to reproduce the error on trunk, a new ticket would be
 better to allow this ticket to remain focused on one bug.

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


More information about the wp-trac mailing list