site_health_test_rest_capability_(check) filter-hookWP 5.6.0

Filters the capability needed to run a given Site Health check.

Usage

add_filter( 'site_health_test_rest_capability_(check)', 'wp_kama_site_health_test_rest_capability_check_filter', 10, 2 );

/**
 * Function for `site_health_test_rest_capability_(check)` filter-hook.
 * 
 * @param string $default_capability The default capability required for this check.
 * @param string $check              The Site Health check being performed.
 *
 * @return string
 */
function wp_kama_site_health_test_rest_capability_check_filter( $default_capability, $check ){

	// filter...
	return $default_capability;
}
$default_capability(string)
The default capability required for this check.
$check(string)
The Site Health check being performed.

Changelog

Since 5.6.0 Introduced.

Where the hook is called

WP_REST_Site_Health_Controller::validate_request_permission()
site_health_test_rest_capability_(check)
wp-includes/rest-api/endpoints/class-wp-rest-site-health-controller.php 180
$capability = apply_filters( "site_health_test_rest_capability_{$check}", $default_capability, $check );

Where the hook is used in WordPress

Usage not found.