months_dropdown_results
Filter HookDescription
Filters the 'Months' drop-down results.Hook Information
File Location |
wp-admin/includes/class-wp-list-table.php
View on GitHub
|
Hook Type | Filter |
Line Number | 758 |
Hook Parameters
Type | Name | Description |
---|---|---|
object[]
|
$months
|
Array of the months drop-down query results. |
string
|
$post_type
|
The post type. |
Usage Examples
Basic Usage
<?php
// Hook into months_dropdown_results
add_filter('months_dropdown_results', 'my_custom_filter', 10, 2);
function my_custom_filter($months, $post_type) {
// Your custom filtering logic here
return $months;
}
Source Code Context
wp-admin/includes/class-wp-list-table.php:758
- How this hook is used in WordPress core
<?php
753 * @since 3.7.0
754 *
755 * @param object[] $months Array of the months drop-down query results.
756 * @param string $post_type The post type.
757 */
758 $months = apply_filters( 'months_dropdown_results', $months, $post_type );
759
760 $month_count = count( $months );
761
762 if ( ! $month_count || ( 1 === $month_count && 0 === (int) $months[0]->month ) ) {
763 return;
PHP Documentation
<?php
/**
* Filters the 'Months' drop-down results.
*
* @since 3.7.0
*
* @param object[] $months Array of the months drop-down query results.
* @param string $post_type The post type.
*/
Quick Info
- Hook Type: Filter
- Parameters: 2
- File: wp-admin/includes/class-wp-list-table.php
Related Hooks
Related hooks will be displayed here in future updates.