WordPress at Your Fingertips
function is not described

WC_Webhook::set_topic() public WC 2.2.0

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

{} It's a method of the class: WC_Webhook{}

No Hooks.

Return

null. Nothing.

Usage

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

Changelog

Since 2.2.0 Introduced.

Code of WC_Webhook::set_topic() WC 6.1.1

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

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

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