WC_Webhook::set_topic()publicWC 2.2.0

Set the webhook topic and associated hooks. The topic resource & event are also saved separately.

Method of the class: WC_Webhook{}

No Hooks.

Return

null. Nothing (null).

Usage

$WC_Webhook = new WC_Webhook();
$WC_Webhook->set_topic( $topic );
$topic(string) (required)
Webhook topic.

Changelog

Since 2.2.0 Introduced.

WC_Webhook::set_topic() code WC 8.7.0

public function set_topic( $topic ) {
	$topic = wc_clean( $topic );

	if ( ! wc_is_webhook_valid_topic( $topic ) ) {
		$topic = '';
	}

	$this->set_prop( 'topic', $topic );
}