WordPress at a glance
filter is not described

media_library_months_with_files filter-hook . WP 4.7.4

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.


add_filter( 'media_library_months_with_files', 'filter_function_name_2355' );
function filter_function_name_2355( $months ){
	// filter...

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

Список изменений

С версии 4.7.4 Введена.

Где вызывается хук

wp-includes/media.php 4106
$months = apply_filters( 'media_library_months_with_files', null );

Где используется хук в ядре WP

Использование не найдено.