On this page
WP_Block_Styles_Registry::get_instance(): WP_Block_Styles_Registry
Utility method to retrieve the main instance of the class.
Description
The instance will be created if it does not exist yet.
Return
WP_Block_Styles_Registry The main instance.
Source
File: wp-includes/class-wp-block-styles-registry.php. View all references
public static function get_instance() {
if ( null === self::$instance ) {
self::$instance = new self();
}
return self::$instance;
}
Related
Used By
| Used By | Description |
|---|---|
| WP_REST_Block_Types_Controller::__construct() wp-includes/rest-api/endpoints/class-wp-rest-block-types-controller.php | Constructor. |
| enqueue_block_styles_assets() wp-includes/script-loader.php | Function responsible for enqueuing the styles required for block styles functionality on the editor and on the frontend. |
| enqueue_editor_block_styles_assets() wp-includes/script-loader.php | Function responsible for enqueuing the assets required for block styles functionality on the editor. |
| register_block_style() wp-includes/blocks.php | Registers a new block style. |
| unregister_block_style() wp-includes/blocks.php | Unregisters a block style. |
Changelog
| Version | Description |
|---|---|
| 5.3.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_block_styles_registry/get_instance