Automattic\WooCommerce\Admin\Marketing

MarketingChannels::register()publicWC 1.0

Registers a marketing channel.

Method of the class: MarketingChannels{}

No Hooks.

Return

null. Nothing (null).

Usage

$MarketingChannels = new MarketingChannels();
$MarketingChannels->register( $channel ): void;
$channel(MarketingChannelInterface) (required)
The marketing channel to register.

MarketingChannels::register() code WC 9.0.1

public function register( MarketingChannelInterface $channel ): void {
	if ( isset( $this->registered_channels[ $channel->get_slug() ] ) ) {
		throw new Exception( __( 'Marketing channel cannot be registered because there is already a channel registered with the same slug!', 'woocommerce' ) );
	}

	$this->registered_channels[ $channel->get_slug() ] = $channel;
}