woocommerce_webhook_topic
Get the webhook topic, e.g. order.created.
Usage
add_filter( 'woocommerce_webhook_topic', 'wp_kama_woocommerce_webhook_topic_filter', 10, 2 );
/**
* Function for `woocommerce_webhook_topic` filter-hook.
*
* @param string $context What the value is for. Valid values are 'view' and 'edit'.
* @param $id
*
* @return string
*/
function wp_kama_woocommerce_webhook_topic_filter( $context, $id ){
// filter...
return $context;
}
- $context(string)
- What the value is for. Valid values are 'view' and 'edit'.
- $id
- -
Changelog
| Since 2.2.0 | Introduced. |
Where the hook is called
woocommerce_webhook_topic
woocommerce/includes/class-wc-webhook.php 727
return apply_filters( 'woocommerce_webhook_topic', $this->get_prop( 'topic', $context ), $this->get_id() );