Filter hook 'media_library_months_with_files'
in WP Core File wp-includes/media.php at line 4692
Description
Allows overriding the list of months displayed in the media library. By default (if this filter does not return an array), a query will be run to determine the months that have media items. This query can be expensive for large media libraries, so it may be desirable for sites to override this behavior.
Occurrences
Filename |
Line Number |
wp-includes/media.php |
4692 |
Parameters
Type |
Name |
Description |
stdClass[]|null |
$months |
An array of objects with `month` and `year` properties, or `null` for default behavior. |
PHP Doc
/**
* Allows overriding the list of months displayed in the media library.
*
* By default (if this filter does not return an array), a query will be
* run to determine the months that have media items. This query can be
* expensive for large media libraries, so it may be desirable for sites to
* override this behavior.
*
* @since 4.7.4
*
* @link https://core.trac.wordpress.org/ticket/31071
*
* @param stdClass[]|null $months An array of objects with `month` and `year`
* properties, or `null` for default behavior.
*/