WordPress filter hook
woocommerce_webhook_topic_hooks
Defined by WooCommerce and fired by 2 plugins in total, running on 7M+ sites between them.
“Filters the map of webhook topics to their registered hook names.”
How to use woocommerce_webhook_topic_hooks
It's a filter: your callback receives the value and 1 more argument, and must return the (changed) value.
Add this to your theme's functions.php or a small custom plugin:
add_filter( 'woocommerce_webhook_topic_hooks', function( $topic_hooks, $webhook ) {
// Change $topic_hooks here.
return $topic_hooks;
}, 10, 2 );Argument names come from WooCommerce's source. Other plugins may pass different values: check the call in the plugin you're targeting below.
2 plugins that fire woocommerce_webhook_topic_hooks
Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.
-
WooCommerce7+ million installs
apply_filters( 'woocommerce_webhook_topic_hooks', $topic_hooks, $webhook )includes/class-wc-webhook.php:1099 -
StoreAgent700+ installs
apply_filters( 'woocommerce_webhook_topic_hooks', array_fill_keys( $topics, array() ), $webhook instanceof \WC_Webhook ? $webhook : new \WC_Webhook() )includes/Classes/Abilities/Woo_Data/Webhooks.php:634
Need a customisation built on this hook?
Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.