site_status_test_result
Filter HookDescription
Filters the output of a finished Site Health test. Tests are put into categories which have an associated badge shown, these can be modified and assigned here. } }Hook Information
File Location |
wp-admin/includes/class-wp-site-health.php
View on GitHub
|
Hook Type | Filter |
Line Number | 194 |
Hook Parameters
Type | Name | Description |
---|---|---|
array
|
$test_result
|
{ An associative array of test result data. |
Usage Examples
Basic Usage
<?php
// Hook into site_status_test_result
add_filter('site_status_test_result', 'my_custom_filter', 10, 1);
function my_custom_filter($test_result) {
// Your custom filtering logic here
return $test_result;
}
Source Code Context
wp-admin/includes/class-wp-site-health.php:194
- How this hook is used in WordPress core
<?php
189 * @type string $description A more descriptive explanation of what the test looks for, and why it is important for the end user.
190 * @type string $actions An action to direct the user to where they can resolve the issue, if one exists.
191 * @type string $test The name of the test being ran, used as a reference point.
192 * }
193 */
194 return apply_filters( 'site_status_test_result', call_user_func( $callback ) );
195 }
196
197 /**
198 * Runs the SQL version checks.
199 *
PHP Documentation
<?php
/**
* Filters the output of a finished Site Health test.
*
* @since 5.3.0
*
* @param array $test_result {
* An associative array of test result data.
*
* @type string $label A label describing the test, and is used as a header in the output.
* @type string $status The status of the test, which can be a value of `good`, `recommended` or `critical`.
* @type array $badge {
* Tests are put into categories which have an associated badge shown, these can be modified and assigned here.
*
* @type string $label The test label, for example `Performance`.
* @type string $color Default `blue`. A string representing a color to use for the label.
* }
* @type string $description A more descriptive explanation of what the test looks for, and why it is important for the end user.
* @type string $actions An action to direct the user to where they can resolve the issue, if one exists.
* @type string $test The name of the test being ran, used as a reference point.
* }
*/
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.