WPDev.one
Core Class

WP_Block_Templates_Registry

class WP_Block_Templates_Registry // Constructor: function Object() { [native code] }

Core class used for interacting with templates.

Methods 8 methods

Method / Return Description
register()
(WP_Block_Template

Registers a template.

Parameters: $template_name: mixed, $args: mixed
get_all_registered()
WP_Block_Template[]

Retrieves all registered templates.

get_registered()
(WP_Block_Template

Retrieves a registered template by its name.

Parameters: $template_name: mixed
get_by_slug()
(WP_Block_Template

Retrieves a registered template by its slug.

Parameters: $template_slug: mixed
get_by_query()
WP_Block_Template[]

Retrieves registered templates matching a query.

Parameters: $query: mixed
is_registered()
bool

Checks if a template is registered.

Parameters: $template_name: mixed
unregister()
(WP_Block_Template

Unregisters a template.

Parameters: $template_name: mixed
get_instance()
WP_Block_Templates_Registry

Utility method to retrieve the main instance of the class.

Properties

Property / Type Description
$registered_templates
mixed
public
No description available.
$instance
mixed
public
No description available.

Class Information

Since Version
6.7.0
Source File
wp-includes/class-wp-block-templates-registry.php
Advertisement