Make WordPress Core

Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#18092 closed defect (bug) (fixed)

wp_list_filter() OR operator doesn't work

Reported by: kevinb's profile kevinB Owned by: dd32's profile dd32
Milestone: 3.3 Priority: normal
Severity: normal Version: 3.2
Component: General Keywords: has-patch
Focuses: Cc:

Description

wp_list_filter() always returns all elements when the OR operator is passed. This affects corresponding usage of get_post_types(), get_taxonomies(), get_post_stati().

The following call should return only private and public stati, but actually returns all:

$all_stati = get_post_stati( array( 'private' => true, 'public' => true ), 'names', 'OR' );

Attachments (1)

18092.diff (612 bytes) - added by kevinB 14 years ago.
wp_list_filter() : OR operator was broken

Download all attachments as: .zip

Change History (5)

@kevinB
14 years ago

wp_list_filter() : OR operator was broken

#1 @SergeyBiryukov
14 years ago

  • Milestone changed from Awaiting Review to 3.3

#2 @dd32
14 years ago

Altered some test cases to catch this: http://unit-tests.trac.wordpress.org/changeset/437

Patch as-is seems fine based on the test cases, I'll give it a run in the wild on core's usage of it tomorrow.

#3 @dd32
14 years ago

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

In [18711]:

Fix wp_list_filter() OR operator. Props kevinB. Fixes #18092

#4 @dd32
14 years ago

Core doesn't use the OR functionality by default anywhere that I could find.

Note: See TracTickets for help on using tickets.