WC_Webhook::set_topic()
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() WC Webhook::set topic code WC 9.8.2
public function set_topic( $topic ) { $topic = wc_clean( $topic ); if ( ! wc_is_webhook_valid_topic( $topic ) ) { $topic = ''; } $this->set_prop( 'topic', $topic ); }