WP_Site_Health::check_wp_version_check_exists() WordPress Method

The WP_Site_Health::check_wp_version_check_exists() method is used to check if the current WordPress version is the latest version. This is important for security and keeping your site up to date.

WP_Site_Health::check_wp_version_check_exists() #

Test if 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.


Top ↑

Source

File: wp-admin/includes/class-wp-site-health.php

	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();
	}


Top ↑

Changelog

Changelog
VersionDescription
5.2.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.