WP_Block_Styles_Registry::get_instance() WordPress Method

The WP_Block_Styles_Registry::get_instance() method is used to retrieve the global $wp_block_styles object. This object is used to store and maintain a list of all the registered block styles.

WP_Block_Styles_Registry::get_instance() #

Utility method to retrieve the main instance of the class.


Description

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


Top ↑

Return

(WP_Block_Styles_Registry) The main instance.


Top ↑

Source

File: wp-includes/class-wp-block-styles-registry.php

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

		return self::$instance;
	}


Top ↑

Changelog

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