woocommerce_webhook_topic_hooks
Filters the map of webhook topics to their registered hook names.
Usage
add_filter( 'woocommerce_webhook_topic_hooks', 'wp_kama_woocommerce_webhook_topic_hooks_filter', 10, 2 );
/**
* Function for `woocommerce_webhook_topic_hooks` filter-hook.
*
* @param array $topic_hooks Map of topic name to array of hook names.
* @param WC_Webhook $webhook The webhook instance. May be a fresh, unsaved instance when called
* from `WC_Webhook::get_default_topic_hooks()` without a webhook
* context.
*
* @return array
*/
function wp_kama_woocommerce_webhook_topic_hooks_filter( $topic_hooks, $webhook ){
// filter...
return $topic_hooks;
}
- $topic_hooks(array)
- Map of topic name to array of hook names.
- $webhook(WC_Webhook)
- The webhook instance. May be a fresh, unsaved instance when called from
WC_Webhook::get_default_topic_hooks()without a webhook context.
Changelog
| Since 2.2.0 | Introduced. |
Where the hook is called
woocommerce_webhook_topic_hooks
woocommerce/includes/class-wc-webhook.php 1066
return apply_filters( 'woocommerce_webhook_topic_hooks', $topic_hooks, $webhook );