IntegrationRegistry
in package
Class used for tracking registered integrations with various Block types.
Table of Contents
- $registered_integrations : array<string|int, IntegrationInterface>
- Registered integrations, as `$name => $instance` pairs.
- $registry_identifier : string
- Integration identifier is used to construct hook names and is given when the integration registry is initialized.
- get_all_registered() : array<string|int, IntegrationInterface>
- Retrieves all registered integrations.
- get_all_registered_editor_script_handles() : array<string|int, string>
- Gets an array of all registered integration's script handles for the editor.
- get_all_registered_script_data() : array<string|int, mixed>
- Gets an array of all registered integration's script data.
- get_all_registered_script_handles() : array<string|int, string>
- Gets an array of all registered integration's script handles.
- get_registered() : IntegrationInterface|null
- Retrieves a registered Integration by name.
- initialize() : mixed
- Initializes all registered integrations.
- is_registered() : bool
- Checks if an integration is already registered.
- register() : bool
- Registers an integration.
- unregister() : bool|IntegrationInterface
- Un-register an integration.
Properties
$registered_integrations
Registered integrations, as `$name => $instance` pairs.
protected
array<string|int, IntegrationInterface>
$registered_integrations
= []
$registry_identifier
Integration identifier is used to construct hook names and is given when the integration registry is initialized.
protected
string
$registry_identifier
= ''
Methods
get_all_registered()
Retrieves all registered integrations.
public
get_all_registered() : array<string|int, IntegrationInterface>
Return values
array<string|int, IntegrationInterface> —get_all_registered_editor_script_handles()
Gets an array of all registered integration's script handles for the editor.
public
get_all_registered_editor_script_handles() : array<string|int, string>
Return values
array<string|int, string> —get_all_registered_script_data()
Gets an array of all registered integration's script data.
public
get_all_registered_script_data() : array<string|int, mixed>
Return values
array<string|int, mixed> —get_all_registered_script_handles()
Gets an array of all registered integration's script handles.
public
get_all_registered_script_handles() : array<string|int, string>
Return values
array<string|int, string> —get_registered()
Retrieves a registered Integration by name.
public
get_registered(string $name) : IntegrationInterface|null
Parameters
- $name : string
-
Integration name.
Return values
IntegrationInterface|null — The registered integration, or null if it is not registered.initialize()
Initializes all registered integrations.
public
initialize([string $registry_identifier = '' ]) : mixed
Integration identifier is used to construct hook names and is given when the integration registry is initialized.
Parameters
- $registry_identifier : string = ''
-
Identifier for this registry.
Return values
mixed —is_registered()
Checks if an integration is already registered.
public
is_registered(string $name) : bool
Parameters
- $name : string
-
Integration name.
Return values
bool — True if the integration is registered, false otherwise.register()
Registers an integration.
public
register(IntegrationInterface $integration) : bool
Parameters
- $integration : IntegrationInterface
-
An instance of IntegrationInterface.
Return values
bool — True means registered successfully.unregister()
Un-register an integration.
public
unregister(string|IntegrationInterface $name) : bool|IntegrationInterface
Parameters
- $name : string|IntegrationInterface
-
Integration name, or alternatively a IntegrationInterface instance.