On this page
WP_Site_Health::check_wp_version_check_exists()
Tests whether wp_version_check is blocked.
Description
It’s possible to block updates with the wp_version_check filter, but this can’t be checked during an Ajax call, as the filter is never introduced then.
This filter overrides a standard page request if it’s made by an admin through the Ajax call with the right query argument to check for this.
Source
File: wp-admin/includes/class-wp-site-health.php. View all references
public function check_wp_version_check_exists() {
if ( ! is_admin() || ! is_user_logged_in() || ! current_user_can( 'update_core' ) || ! isset( $_GET['health-check-test-wp_version_check'] ) ) {
return;
}
echo ( has_filter( 'wp_version_check', 'wp_version_check' ) ? 'yes' : 'no' );
die();
}
Related
Uses
| Uses | Description |
|---|---|
| has_filter() wp-includes/plugin.php | Checks if any filter has been registered for a hook. |
| current_user_can() wp-includes/capabilities.php | Returns whether the current user has the specified capability. |
| is_user_logged_in() wp-includes/pluggable.php | Determines whether the current visitor is a logged in user. |
| is_admin() wp-includes/load.php | Determines whether the current request is for an administrative interface page. |
Changelog
| Version | Description |
|---|---|
| 5.2.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_site_health/check_wp_version_check_exists