[wp-trac] [WordPress Trac] #59774: Undefined array key when using wp_list_pluck function

WordPress Trac noreply at wordpress.org
Thu Feb 22 20:34:48 UTC 2024


#59774: Undefined array key when using wp_list_pluck function
-------------------------------------------------+-------------------------
 Reporter:  iamarunchaitanyajami                 |       Owner:
                                                 |  hellofromTonya
     Type:  defect (bug)                         |      Status:  reviewing
 Priority:  normal                               |   Milestone:  6.5
Component:  General                              |     Version:  5.1
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch has-testing-info has-      |     Focuses:
  unit-tests                                     |
-------------------------------------------------+-------------------------
Changes (by hellofromTonya):

 * keywords:  has-patch has-testing-info => has-patch has-testing-info has-
     unit-tests
 * owner:  (none) => hellofromTonya
 * status:  new => reviewing


Comment:

 Patch: [attachment:"59774.diff"]

 As @davidbinda noted, the function should behave the same as
 `array_column()` but also handle objects.

 I can reproduce the reported issue. Here it is in action
 https://3v4l.org/RtbZJ#veol.

 After applying the patch, it resolves the issue
 https://3v4l.org/EuHT5#veol

 I'll port the patch over to a PR to let the automated CI jobs run. But
 then should be ready for commit. Self-assigning.

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


More information about the wp-trac mailing list