wp_count_attachments хук-фильтрWP 3.7.0

Modifies returned attachment counts by mime type.

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

add_filter( 'wp_count_attachments', 'wp_kama_count_attachments_filter', 10, 2 );

/**
 * Function for `wp_count_attachments` filter-hook.
 * 
 * @param stdClass        $counts    An object containing the attachment counts by mime type.
 * @param string|string[] $mime_type Array or comma-separated list of MIME patterns.
 *
 * @return stdClass
 */
function wp_kama_count_attachments_filter( $counts, $mime_type ){

	// filter...
	return $counts;
}
$counts(stdClass)
An object containing the attachment counts by mime type.
$mime_type(строка|string[])
Array or comma-separated list of MIME patterns.

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

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

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

wp_count_attachments()
wp_count_attachments
wp-includes/post.php 3120
return apply_filters( 'wp_count_attachments', (object) $counts, $mime_type );

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

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