WordPress.org

Make WordPress Core

Opened 2 years ago

Closed 12 months 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 2 years ago.
20376.2.patch (877 bytes) - added by SergeyBiryukov 18 months ago.
20376.3.patch (741 bytes) - added by kovshenin 14 months ago.
20376.tests.diff (1.3 KB) - added by kovshenin 14 months ago.
20376.4.patch (868 bytes) - added by DrewAPicture 12 months ago.
Refresh.

Download all attachments as: .zip

Change History (21)

SergeyBiryukov2 years ago

comment:1 SergeyBiryukov2 years ago

  • Keywords has-patch added; needs-patch removed

Related: #15292

comment:2 wonderboymusic20 months ago

  • Milestone changed from Awaiting Review to 3.5

comment:3 nacin18 months 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.

comment:4 nacin18 months ago

In 22464:

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

comment:5 nacin18 months 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.

comment:6 nacin18 months ago

  • Owner nacin deleted
  • Status changed from reopened to assigned

comment:7 SergeyBiryukov18 months ago

  • Keywords has-patch added; needs-patch removed

SergeyBiryukov18 months ago

comment:8 rmccue18 months ago

  • Keywords commit added

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

comment:9 knutsp17 months ago

  • Cc knut@… added

comment:10 SergeyBiryukov16 months ago

  • Milestone changed from Future Release to 3.6

comment:11 SergeyBiryukov14 months ago

  • Keywords needs-unit-tests added

kovshenin14 months ago

kovshenin14 months ago

comment:12 kovshenin14 months ago

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

DrewAPicture12 months ago

Refresh.

comment:14 SergeyBiryukov12 months ago

In 1279/tests:

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

comment:15 SergeyBiryukov12 months ago

  • Keywords needs-unit-tests removed

comment:16 SergeyBiryukov12 months 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.