site_status_should_suggest_persistent_object_cache
Filter HookDescription
Filters whether to suggest use of a persistent object cache and bypass default threshold checks. Using this filter allows to override the default logic, effectively short-circuiting the method.Hook Information
File Location |
wp-admin/includes/class-wp-site-health.php
View on GitHub
|
Hook Type | Filter |
Line Number | 3526 |
Hook Parameters
Type | Name | Description |
---|---|---|
bool|null
|
$suggest
|
Boolean to short-circuit, for whether to suggest using a persistent object cache. Default null. |
Usage Examples
Basic Usage
<?php
// Hook into site_status_should_suggest_persistent_object_cache
add_filter('site_status_should_suggest_persistent_object_cache', 'my_custom_filter', 10, 1);
function my_custom_filter($suggest) {
// Your custom filtering logic here
return $suggest;
}
Source Code Context
wp-admin/includes/class-wp-site-health.php:3526
- How this hook is used in WordPress core
<?php
3521 * @since 6.1.0
3522 *
3523 * @param bool|null $suggest Boolean to short-circuit, for whether to suggest using a persistent object cache.
3524 * Default null.
3525 */
3526 $short_circuit = apply_filters( 'site_status_should_suggest_persistent_object_cache', null );
3527 if ( is_bool( $short_circuit ) ) {
3528 return $short_circuit;
3529 }
3530
3531 if ( is_multisite() ) {
PHP Documentation
<?php
/**
* Filters whether to suggest use of a persistent object cache and bypass default threshold checks.
*
* Using this filter allows to override the default logic, effectively short-circuiting the method.
*
* @since 6.1.0
*
* @param bool|null $suggest Boolean to short-circuit, for whether to suggest using a persistent object cache.
* Default null.
*/
Quick Info
- Hook Type: Filter
- Parameters: 1
- File: wp-admin/includes/class-wp-site-health.php
Related Hooks
Related hooks will be displayed here in future updates.