Automattic\WooCommerce\Admin\Marketing

MarketingChannels::register()publicWC 1.0

Registers a marketing channel.

Метод класса: MarketingChannels{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

$MarketingChannels = new MarketingChannels();
$MarketingChannels->register( $channel ): void;
$channel(MarketingChannelInterface) (обязательный)
The marketing channel to register.

Код MarketingChannels::register() WC 8.9.0

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;
}