mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-10 02:18:58 +01:00
Administration: New filter ahead of the months drop-down.
As this can cause large, long running queries on sites with many posts, this filter allows the query to be modified, bypassing entirely if needed. Fixes #51660. Props geoffguillain, SergeyBiryukov, hareesh-pillai, hellofromTonya, TimothyBlynJacobs, whyisjake. Built from https://develop.svn.wordpress.org/trunk@50163 git-svn-id: http://core.svn.wordpress.org/trunk@49842 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
56c9aa3cab
commit
8e8fe6d2c0
@ -595,6 +595,17 @@ class WP_List_Table {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Filters to short-circuit performing the months dropdown query.
|
||||||
|
*
|
||||||
|
* @since 5.7.0
|
||||||
|
*
|
||||||
|
* @param object[]|false $months 'Months' drop-down results. Default false.
|
||||||
|
* @param string $post_type The post type.
|
||||||
|
*/
|
||||||
|
$months = apply_filters( 'pre_months_dropdown_query', false, $post_type );
|
||||||
|
|
||||||
|
if ( ! is_array( $months ) ) {
|
||||||
$extra_checks = "AND post_status != 'auto-draft'";
|
$extra_checks = "AND post_status != 'auto-draft'";
|
||||||
if ( ! isset( $_GET['post_status'] ) || 'trash' !== $_GET['post_status'] ) {
|
if ( ! isset( $_GET['post_status'] ) || 'trash' !== $_GET['post_status'] ) {
|
||||||
$extra_checks .= " AND post_status != 'trash'";
|
$extra_checks .= " AND post_status != 'trash'";
|
||||||
@ -624,6 +635,7 @@ class WP_List_Table {
|
|||||||
* @param string $post_type The post type.
|
* @param string $post_type The post type.
|
||||||
*/
|
*/
|
||||||
$months = apply_filters( 'months_dropdown_results', $months, $post_type );
|
$months = apply_filters( 'months_dropdown_results', $months, $post_type );
|
||||||
|
}
|
||||||
|
|
||||||
$month_count = count( $months );
|
$month_count = count( $months );
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '5.7-alpha-50162';
|
$wp_version = '5.7-alpha-50163';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
Loading…
Reference in New Issue
Block a user