WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 5 years ago

#20376 closed defect (bug) (fixed)

wp_list_pages fails with meta_value=0 criteria

Reported by: Big Tick Owned by: SergeyBiryukov
Milestone: 3.6 Priority: normal
Severity: normal Version: 3.3.1
Component: Query Keywords: has-patch commit
Focuses: Cc:

Description

The following code will ignore the meta_key filtering. In other words, wp_list_pages can't test for a meta_value of 0.

wp_list_pages(
  array(
    'meta_key' => 'a_custom_key',
    'meta_value' => '0'
  )
)

Attachments (5)

20376.patch (843 bytes) - added by SergeyBiryukov 6 years ago.
20376.2.patch (877 bytes) - added by SergeyBiryukov 6 years ago.
20376.3.patch (741 bytes) - added by kovshenin 5 years ago.
20376.tests.diff (1.3 KB) - added by kovshenin 5 years ago.
20376.4.patch (868 bytes) - added by DrewAPicture 5 years ago.
Refresh.

Download all attachments as: .zip

Change History (21)

#1 @SergeyBiryukov
6 years ago

  • Keywords has-patch added; needs-patch removed

Related: #15292

#2 @wonderboymusic
6 years ago

  • Milestone changed from Awaiting Review to 3.5

#3 @nacin
6 years ago

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

In 22445:

Fix meta value querying in wp_list_pages(). props SergeyBiryukov. fixes #20376.

#4 @nacin
6 years ago

In 22464:

Revert [22445]. see #20376. fixes #22389.

#5 @nacin
6 years ago

  • Keywords needs-patch added; has-patch removed
  • Milestone changed from 3.5 to Future Release
  • Resolution fixed deleted
  • Status changed from closed to reopened

See #22389.

#6 @nacin
6 years ago

  • Owner nacin deleted
  • Status changed from reopened to assigned

#7 @SergeyBiryukov
6 years ago

  • Keywords has-patch added; needs-patch removed

#8 @rmccue
6 years ago

  • Keywords commit added

No regression on wp_dropdown_pages(), looks good to me.

#9 @knutsp
6 years ago

  • Cc knut@… added

#10 @SergeyBiryukov
5 years ago

  • Milestone changed from Future Release to 3.6

#11 @SergeyBiryukov
5 years ago

  • Keywords needs-unit-tests added

@kovshenin
5 years ago

#12 @kovshenin
5 years ago

Refreshed 20376.3.patch and added unit tests for meta queries in get_pages and wp_dropdown_pages in 20376.tests.diff.

@DrewAPicture
5 years ago

Refresh.

#14 @SergeyBiryukov
5 years ago

In 1279/tests:

get_pages() test for '0' as meta_value argument and a basic wp_dropdown_pages() test. props kovshenin. see #20376.

#15 @SergeyBiryukov
5 years ago

  • Keywords needs-unit-tests removed

#16 @SergeyBiryukov
5 years ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from assigned to closed

In 24238:

Fix handling of '0' as meta_value argument in get_pages(). fixes #20376.

Note: See TracTickets for help on using tickets.