WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 7 months ago

#17022 closed enhancement (fixed)

months_dropdown() is not filterable

Reported by: kevinB Owned by: DrewAPicture
Milestone: 3.7 Priority: normal
Severity: normal Version:
Component: Query Keywords: has-patch
Focuses: Cc:

Description

The months_dropdown() function used on the Edit Posts and Media Library listing forms is not filterable. This causes invalid month items when a plugin uses the WP_Query API to filter editable posts.

The corresponding patch adds the query filter 'months_dropdown_query'

Attachments (4)

months_dropdown_3.2.patch (745 bytes) - added by kevinB 3 years ago.
query filter for months_dropdown()
17022.diff (816 bytes) - added by wonderboymusic 9 months ago.
17022.2.diff (1.0 KB) - added by DrewAPicture 7 months ago.
filter docs
17022.3.diff (718 bytes) - added by DrewAPicture 7 months ago.
results filter

Download all attachments as: .zip

Change History (13)

kevinB3 years ago

query filter for months_dropdown()

comment:1 scribu3 years ago

Related: #17025

comment:2 scribu3 years ago

  • Summary changed from Edit Posts / Media Library: add hook for months_dropdown() to months_dropdown() is not filterable

wonderboymusic9 months ago

comment:3 wonderboymusic9 months ago

  • Milestone changed from Awaiting Review to 3.7

Slightly altered the style of the patch. The filter seems like a reasonable request.

comment:4 wonderboymusic8 months ago

  • Keywords needs-docs added

There's a new filter

DrewAPicture7 months ago

filter docs

comment:5 DrewAPicture7 months ago

  • Keywords needs-docs removed

17022.2.diff adds a docblock for the months_dropdown_query filter hook.

comment:6 nacin7 months ago

See my reservations about filtering SQL directly in #17025. Can we filter what the SQL returns instead?

comment:7 wonderboymusic7 months ago

  • Keywords needs-refresh added

see @nacin's comment - needs alternate filter approach

DrewAPicture7 months ago

results filter

comment:8 DrewAPicture7 months ago

  • Keywords needs-refresh removed

17022.3.diff instead filters the results re: comment:6. Includes filter docs.

comment:9 DrewAPicture7 months ago

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

In 25556:

Make the WP_List_Table::months_dropdown() query results filterable.

Introduces the months_dropdown_results filter.

Fixes #17022.

Note: See TracTickets for help on using tickets.