site_status_page_cache_supported_cache_headers filter-hookWP 6.1.0

Filters the list of cache headers supported by core.

This list indicates how each of the specified headers will be checked to indicate if a page cache is enabled or not. WordPress checks for each of the headers in the returned array. If the callback is provided, it will be passed the value for the corresponding header and return a boolean value indicating if the header suggests that a cache is active. If the value is null for the header, then WordPress will assume that a cache is active if the header is present, regardless of its value.

Usage

add_filter( 'site_status_page_cache_supported_cache_headers', 'wp_kama_site_status_page_cache_supported_headers_filter' );

/**
 * Function for `site_status_page_cache_supported_cache_headers` filter-hook.
 * 
 * @param array $cache_headers Mapping from cache-related HTTP headers to whether they indicate if a page cache is enabled for the site. `null` indicates caching in the presence of the header; a callback is provided the header’s value and should return `true` if it implies that a cache is active.
 *
 * @return array
$cache_headers(array<string,)
?callable> $cache_headers Mapping from cache-related HTTP headers to whether they indicate if a page cache is enabled for the site. null indicates caching in the presence of the header; a callback is provided the header’s value and should return true if it implies that a cache is active.

Changelog

Since 6.1.0 Introduced.

Where the hook is called

site_status_page_cache_supported_cache_headers
wp-admin/includes/class-wp-site-health.php 3595
return (array) apply_filters( 'site_status_page_cache_supported_cache_headers', $cache_headers );

Where the hook is used in WordPress

Usage not found.