Opened 3 years ago

Closed 3 years ago

#15016 closed enhancement (fixed)

Split wp_filter_object_list() in two

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

Description

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 3 years ago.
wp_list_filter.2.diff (2.8 KB) - added by scribu 3 years ago.
Use in WP_Query
wp_list_filter.3.diff (2.8 KB) - added by scribu 3 years ago.
Check $field before calling wp_list_pluck()

Download all attachments as: .zip

Change History (4)

scribu3 years ago

scribu3 years ago

Use in WP_Query

scribu3 years ago

Check $field before calling wp_list_pluck()

  • 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.