Filter hook 'site_status_persistent_object_cache_notes'

in WP Core File wp-admin/includes/class-wp-site-health.php at line 2569

View Source

site_status_persistent_object_cache_notes

Filter Hook
Description
Filters the second paragraph of the health check's description when suggesting the use of a persistent object cache. Hosts may want to replace the notes to recommend their preferred object caching solution. Plugin authors may want to append notes (not replace) on why object caching is recommended for their plugin.

Hook Information

File Location wp-admin/includes/class-wp-site-health.php View on GitHub
Hook Type Filter
Line Number 2569

Hook Parameters

Type Name Description
string $notes The notes appended to the health check description.
string[] $available_services The list of available persistent object cache services.

Usage Examples

Basic Usage
<?php
// Hook into site_status_persistent_object_cache_notes
add_filter('site_status_persistent_object_cache_notes', 'my_custom_filter', 10, 2);

function my_custom_filter($notes, $available_services) {
    // Your custom filtering logic here
    return $notes;
}

Source Code Context

wp-admin/includes/class-wp-site-health.php:2569 - How this hook is used in WordPress core
<?php
2564  		 * @since 6.1.0
2565  		 *
2566  		 * @param string   $notes              The notes appended to the health check description.
2567  		 * @param string[] $available_services The list of available persistent object cache services.
2568  		 */
2569  		$notes = apply_filters( 'site_status_persistent_object_cache_notes', $notes, $available_services );
2570  
2571  		$result['status']       = 'recommended';
2572  		$result['label']        = __( 'You should use a persistent object cache' );
2573  		$result['description'] .= sprintf(
2574  			'<p>%s</p>',

PHP Documentation

<?php
/**
		 * Filters the second paragraph of the health check's description
		 * when suggesting the use of a persistent object cache.
		 *
		 * Hosts may want to replace the notes to recommend their preferred object caching solution.
		 *
		 * Plugin authors may want to append notes (not replace) on why object caching is recommended for their plugin.
		 *
		 * @since 6.1.0
		 *
		 * @param string   $notes              The notes appended to the health check description.
		 * @param string[] $available_services The list of available persistent object cache services.
		 */
Quick Info
  • Hook Type: Filter
  • Parameters: 2
  • File: wp-admin/includes/class-wp-site-health.php
Related Hooks

Related hooks will be displayed here in future updates.