[wp-trac] [WordPress Trac] #51660: Adding a filter to WP_List_Table::months_dropdown() to allow overriding the list of months displayed

WordPress Trac noreply at wordpress.org
Thu Oct 29 01:38:34 UTC 2020


#51660: Adding a filter to WP_List_Table::months_dropdown() to allow overriding the
list of months displayed
----------------------------+-----------------------------
 Reporter:  geoffguillain   |      Owner:  (none)
     Type:  enhancement     |     Status:  new
 Priority:  normal          |  Milestone:  Awaiting Review
Component:  Administration  |    Version:
 Severity:  normal          |   Keywords:
  Focuses:  performance     |
----------------------------+-----------------------------
 In [https://core.trac.wordpress.org/browser/tags/5.5.1/src/wp-
 admin/includes/class-wp-list-table.php#L583
 WP_List_Table::months_dropdown()], a query is run to determine the months
 that have post items.

 This query can be expensive for large posts/custom posts listing, so it
 may be desirable for sites to override this behavior. I am monitoring
 around 500ms for 500k+ posts.

 The filter available, disable_months_dropdown, only allows removing the
 dropdown not overriding the query.

 A [https://core.trac.wordpress.org/browser/tags/5.5.1/src/wp-
 includes/media.php#L4106 similar filter (media_library_months_with_files)]
 has been set previously for the media library. I was expecting a similar
 behavior for the month dropdown on post listing pages

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/51660>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list