On this page
WP_Block_Patterns_Registry::get_instance(): WP_Block_Patterns_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_Patterns_Registry The main instance.
Source
File: wp-includes/class-wp-block-patterns-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 |
|---|---|
| _register_remote_theme_patterns() wp-includes/block-patterns.php | Registers patterns from Pattern Directory provided by a theme’s |
| _register_theme_block_patterns() wp-includes/block-patterns.php | Register any patterns that the active theme may provide under its |
| WP_REST_Block_Patterns_Controller::get_items() wp-includes/rest-api/endpoints/class-wp-rest-block-patterns-controller.php | Retrieves all block patterns. |
| _load_remote_featured_patterns() wp-includes/block-patterns.php | Register |
| register_block_pattern() wp-includes/class-wp-block-patterns-registry.php | Registers a new block pattern. |
| unregister_block_pattern() wp-includes/class-wp-block-patterns-registry.php | Unregisters a block pattern. |
Changelog
| Version | Description |
|---|---|
| 5.5.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_block_patterns_registry/get_instance