wppaste
WordPress

apply_filters( 'pre_months_dropdown_query', object[]|false $months, string $post_type )

Since
5.7.0
Filters whether to short-circuit performing the months dropdown query.

Compatibility

WordPress
since 5.7.0
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0).

Parameters

$monthsobject[]|false
'Months' drop-down results. Default false.
$post_typestring
The post type.

Where this hook fires · 1

  • wp-admin/includes/class-wp-list-table.php:728WP_List_Table::months_dropdown()

Source code

		 *		 * @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'";			if ( ! isset( $_GET['post_status'] ) || 'trash' !== $_GET['post_status'] ) {				$extra_checks .= " AND post_status != 'trash'";			} elseif ( isset( $_GET['post_status'] ) ) {

Changelog

Introduced in 5.7.0. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 6.7.7 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.