Automattic\WooCommerce\Blocks\Integrations
IntegrationRegistry::register
Registers an integration.
Метод класса: IntegrationRegistry{}
Хуков нет.
Возвращает
true|false. True means registered successfully.
Использование
$IntegrationRegistry = new IntegrationRegistry(); $IntegrationRegistry->register( $integration );
- $integration(IntegrationInterface) (обязательный)
- An instance of IntegrationInterface.
Код IntegrationRegistry::register() IntegrationRegistry::register WC 11.0.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;
}