Automattic\WooCommerce\Blocks\Integrations
IntegrationRegistry::unregister
Un-register an integration.
Метод класса: IntegrationRegistry{}
Хуков нет.
Возвращает
true|false|IntegrationInterface. Returns the unregistered integration instance if unregistered successfully.
Использование
$IntegrationRegistry = new IntegrationRegistry(); $IntegrationRegistry->unregister( $name );
- $name(строка|IntegrationInterface) (обязательный)
- Integration name, or alternatively a IntegrationInterface instance.
Код IntegrationRegistry::unregister() IntegrationRegistry::unregister WC 10.7.0
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;
}