Automattic\WooCommerce\Blocks\Integrations
IntegrationRegistry::register
Registers an integration.
Method of the class: IntegrationRegistry{}
No Hooks.
Returns
true|false. True means registered successfully.
Usage
$IntegrationRegistry = new IntegrationRegistry(); $IntegrationRegistry->register( $integration );
- $integration(IntegrationInterface) (required)
- An instance of IntegrationInterface.
IntegrationRegistry::register() IntegrationRegistry::register code WC 10.7.0
public function register( IntegrationInterface $integration ) {
$name = $integration->get_name();
if ( $this->is_registered( $name ) ) {
/* translators: %s: Integration name. */
_doing_it_wrong( __METHOD__, esc_html( sprintf( __( '"%s" is already registered.', 'woocommerce' ), $name ) ), '4.6.0' );
return false;
}
$this->registered_integrations[ $name ] = $integration;
return true;
}