Automattic\WooCommerce\Blocks\Integrations
IntegrationRegistry::initialize()
Initializes all registered integrations.
Integration identifier is used to construct hook names and is given when the integration registry is initialized.
Method of the class: IntegrationRegistry{}
Hooks from the method
Return
null
. Nothing (null).
Usage
$IntegrationRegistry = new IntegrationRegistry(); $IntegrationRegistry->initialize( $registry_identifier );
- $registry_identifier(string)
- Identifier for this registry.
Default: ''
IntegrationRegistry::initialize() IntegrationRegistry::initialize code WC 9.8.2
public function initialize( $registry_identifier = '' ) { if ( $registry_identifier ) { $this->registry_identifier = $registry_identifier; } if ( empty( $this->registry_identifier ) ) { _doing_it_wrong( __METHOD__, esc_html__( 'Integration registry requires an identifier.', 'woocommerce' ), '4.6.0' ); return false; } /** * Fires when the IntegrationRegistry is initialized. * * Runs before integrations are initialized allowing new integration to be registered for use. This should be * used as the primary hook for integrations to include their scripts, styles, and other code extending the * blocks. * * @since 4.6.0 * * @param IntegrationRegistry $this Instance of the IntegrationRegistry class which exposes the IntegrationRegistry::register() method. */ do_action( 'woocommerce_blocks_' . $this->registry_identifier . '_registration', $this ); foreach ( $this->get_all_registered() as $registered_integration ) { $registered_integration->initialize(); } }