On this page
apply_filters( 'media_library_months_with_files', stdClass[]|null $months )
Allows overriding the list of months displayed in the media library.
Description
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.
Parameters
$monthsstdClass[]|null-
An array of objects with
monthandyearproperties, ornullfor default behavior.
Source
File: wp-includes/media.php. View all references
$months = apply_filters( 'media_library_months_with_files', null );
Related
Used By
| Used By | Description |
|---|---|
| wp_enqueue_media() wp-includes/media.php | Enqueues all scripts, styles, settings, and templates necessary to use all media JS APIs. |
Changelog
| Version | Description |
|---|---|
| 4.7.4 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/media_library_months_with_files