apply_filters( 'site_status_page_cache_supported_cache_headers', \array<string, )
- Since
- 6.1.0
Filters the list of cache headers supported by core.
Description
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.
Compatibility
- WordPress
- since 6.1.0
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in every tracked release (6.7.7 to 7.1.0).
Parameters
\array<string,- ?callable> $cache_headers Mapping from cache-related HTTP headers to whether they indicate if a page cache is enabled for the site.
nullindicates caching in the presence of the header; a callback is provided the header’s value and should returntrueif it implies that a cache is active.
Where this hook fires · 1
wp-admin/includes/class-wp-site-health.php:3596WP_Site_Health::get_page_cache_headers()
Source code
* @param 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. */ return (array) apply_filters( 'site_status_page_cache_supported_cache_headers', $cache_headers ); } /** * Checks if site has page cache enabled or not. * * @since 6.1.0Changelog
Introduced in 6.1.0. 2 changes between 6.7.7 and 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
7.0.4
Parameter `` added.verified against source
7.0.4
Parameter
$cache_headers removed.verified against source6.1.0
Introduced.from the docblock
About this page
- Parsed data
- Generated from the wordpress-develop 7.1.0 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
- Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.