Make WordPress Core

Opened 5 years ago

Closed 2 years 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:


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 5 years ago.
query filter for months_dropdown()
17022.diff (816 bytes) - added by wonderboymusic 2 years ago.
17022.2.diff (1.0 KB) - added by DrewAPicture 2 years ago.
filter docs
17022.3.diff (718 bytes) - added by DrewAPicture 2 years ago.
results filter

Download all attachments as: .zip

Change History (13)

5 years ago

query filter for months_dropdown()

#1 @scribu
5 years ago

Related: #17025

#2 @scribu
5 years ago

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

2 years ago

#3 @wonderboymusic
2 years ago

  • Milestone changed from Awaiting Review to 3.7

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

#4 @wonderboymusic
2 years ago

  • Keywords needs-docs added

There's a new filter

2 years ago

filter docs

#5 @DrewAPicture
2 years ago

  • Keywords needs-docs removed

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

#6 @nacin
2 years ago

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

#7 @wonderboymusic
2 years ago

  • Keywords needs-refresh added

see @nacin's comment - needs alternate filter approach

2 years ago

results filter

#8 @DrewAPicture
2 years ago

  • Keywords needs-refresh removed

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

#9 @DrewAPicture
2 years 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.