WP_Site_Health::get_instance() WordPress Method

The WP_Site_Health::get_instance() method is used to retrieve the global Site Health object. This can be used to access any of the Site Health methods and properties.

WP_Site_Health::get_instance() #

Return an instance of the WP_Site_Health class, or create one if none exist yet.


Return

(WP_Site_Health|null)


Top ↑

Source

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

	public static function get_instance() {
		if ( null === self::$instance ) {
			self::$instance = new WP_Site_Health();
		}

		return self::$instance;
	}


Top ↑

Changelog

Changelog
VersionDescription
5.4.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.