Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#15016 closed enhancement (fixed)

Split wp_filter_object_list() in two

Reported by: scribu Owned by:
Milestone: 3.1 Priority: normal
Severity: normal Version:
Component: General Keywords: has-patch
Focuses: Cc:


The wp_filter_object_list() is actually two distinct operations merged into one.

It would be better if each operation was split into it's own utility function:

wp_list_filter() - filter a list of objects

wp_list_pluck() - pluck a field out of each object in a list

Attachments (3)

wp_list_filter.diff (2.2 KB) - added by scribu 5 years ago.
wp_list_filter.2.diff (2.8 KB) - added by scribu 5 years ago.
Use in WP_Query
wp_list_filter.3.diff (2.8 KB) - added by scribu 5 years ago.
Check $field before calling wp_list_pluck()

Download all attachments as: .zip

Change History (4)

@scribu5 years ago

@scribu5 years ago

Use in WP_Query

@scribu5 years ago

Check $field before calling wp_list_pluck()

comment:1 @scribu5 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [15686]) Split wp_filter_object_list() into wp_list_filter() and wp_list_pluck(). Fixes #15016

Note: See TracTickets for help on using tickets.