WooCommerce Code Reference

LayoutTemplateRegistry
in package

Removed layout template registry.

Tags
deprecated
10.9.0

Block template extension APIs were deprecated. The block templates API was removed in 11.0.0 with no replacement.

Table of Contents

$instance  : LayoutTemplateRegistry|null
Singleton instance.
$removal_warning_logged  : bool
Whether the removal warning has already been logged for the current request.
__construct()  : mixed
Constructor.
get_instance()  : LayoutTemplateRegistry
Get the singleton instance.
instantiate_layout_templates()  : array<string|int, mixed>
Instantiate the matching layout templates and return them.
is_registered()  : bool
Check if a layout template is registered.
register()  : void
Register a single layout template.
unregister_all()  : void
Unregister all layout templates.
maybe_log_removal_warning()  : void
Log a warning about the removed compatibility class.

Properties

Methods

instantiate_layout_templates()

Instantiate the matching layout templates and return them.

public instantiate_layout_templates([array<string|int, mixed> $query_params = array() ]) : array<string|int, mixed>
Parameters
$query_params : array<string|int, mixed> = array()

Query params.

Return values
array<string|int, mixed>

is_registered()

Check if a layout template is registered.

public is_registered(string $layout_template_id) : bool
Parameters
$layout_template_id : string

Layout template ID.

Return values
bool

register()

Register a single layout template.

public register(string $layout_template_id, string $layout_template_area, string $layout_template_class_name) : void
Parameters
$layout_template_id : string

Layout template ID.

$layout_template_area : string

Layout template area.

$layout_template_class_name : string

Layout template class to register.

Return values
void