media_library_months_with_files WordPress Filter Hook

The media_library_months_with_files hook is used to return an array of months for which the media library has files.

apply_filters( 'media_library_months_with_files', array|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.


Top ↑

Parameters

$months

(array|null)An array of objects with month and year properties, or null (or any other non-array value) for default behavior.


Top ↑

Source

File: wp-includes/media.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
4.7.4Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More
Show More