W3cubDocs

/WordPress

WP_Font_Library::get_instance(): WP_Font_Library

Utility method to retrieve the main instance of the class.

Description

The instance will be created if it does not exist yet.

Return

WP_Font_Library The main instance.

Source

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

	return self::$instance;
}

Changelog

Version Description
6.5.0 Introduced.

© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_font_library/get_instance