Automattic\WooCommerce\Blocks\Integrations
IntegrationRegistry::unregister()
Un-register an integration.
Method of the class: IntegrationRegistry{}
No Hooks.
Return
true|false|IntegrationInterface
. Returns the unregistered integration instance if unregistered successfully.
Usage
$IntegrationRegistry = new IntegrationRegistry(); $IntegrationRegistry->unregister( $name );
- $name(string|IntegrationInterface) (required)
- Integration name, or alternatively a IntegrationInterface instance.
IntegrationRegistry::unregister() IntegrationRegistry::unregister code WC 9.8.1
public function unregister( $name ) { if ( $name instanceof IntegrationInterface ) { $name = $name->get_name(); } if ( ! $this->is_registered( $name ) ) { /* translators: %s: Integration name. */ _doing_it_wrong( __METHOD__, esc_html( sprintf( __( 'Integration "%s" is not registered.', 'woocommerce' ), $name ) ), '4.6.0' ); return false; } $unregistered = $this->registered_integrations[ $name ]; unset( $this->registered_integrations[ $name ] ); return $unregistered; }