LayoutTemplateRegistry
in package
Layout template registry.
Table of Contents
- $layout_template_instances : array<string|int, mixed>
- Layout template instances.
- $layout_templates_info : array<string|int, mixed>
- Layout templates info.
- $instance : LayoutTemplateRegistry|null
- Class instance.
- get_instance() : LayoutTemplateRegistry
- Get the instance of the class.
- 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() : mixed
- Register a single layout template.
- unregister_all() : mixed
- Unregister all layout templates.
- get_layout_template_instance() : BlockTemplateInterface
- Instantiate a single layout template and return it.
- get_matching_layout_templates_info() : array<string|int, mixed>
- Get matching layout templates info.
Properties
$layout_template_instances
Layout template instances.
protected
array<string|int, mixed>
$layout_template_instances
= array()
$layout_templates_info
Layout templates info.
protected
array<string|int, mixed>
$layout_templates_info
= array()
$instance
Class instance.
private
static LayoutTemplateRegistry|null
$instance
= null
Methods
get_instance()
Get the instance of the class.
public
static get_instance() : LayoutTemplateRegistry
Return values
LayoutTemplateRegistry —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) : mixed
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.
Tags
Return values
mixed —unregister_all()
Unregister all layout templates.
public
unregister_all() : mixed
Return values
mixed —get_layout_template_instance()
Instantiate a single layout template and return it.
private
get_layout_template_instance(array<string|int, mixed> $layout_template_info) : BlockTemplateInterface
Parameters
- $layout_template_info : array<string|int, mixed>
-
Layout template info.
Return values
BlockTemplateInterface —get_matching_layout_templates_info()
Get matching layout templates info.
private
get_matching_layout_templates_info([array<string|int, mixed> $query_params = array() ]) : array<string|int, mixed>
Parameters
- $query_params : array<string|int, mixed> = array()
-
Query params.