automator_mcp_webhook_trigger_codes
Filter the list of trigger codes that receive auto-generated webhook URLs. Third-party integrations that register webhook triggers can add their trigger codes here so the MCP server returns the inbound URL on creation. Filters webhook trigger codes to include auto-generated webhook URLs for third-party integrations when webhook triggers are registered.
add_filter( 'automator_mcp_webhook_trigger_codes', $callback, 10, 1 );
Description
This filter hook allows developers to modify the array of trigger codes that Uncanny Automator Pro automatically generates webhook URLs for. Third-party integrations can hook into this filter to register their own webhook triggers, ensuring their trigger codes are included when the MCP server creates inbound URLs. This filter fires before webhook URLs are cached and returned.
Usage
add_filter( 'automator_mcp_webhook_trigger_codes', 'your_function_name', 10, 1 );
Parameters
-
$codes(string[]) - Webhook trigger codes.
Return Value
The filtered value.
Examples
<?php
/**
* Add custom webhook trigger codes to Uncanny Automator Pro.
*
* This function hooks into the 'automator_mcp_webhook_trigger_codes' filter
* to add our own custom trigger codes that should receive auto-generated
* webhook URLs.
*
* @param array $trigger_codes The existing array of trigger codes.
* @return array The modified array of trigger codes, including custom ones.
*/
function my_custom_automator_pro_webhook_triggers( $trigger_codes ) {
// Add our custom trigger code(s) to the list.
// Replace 'my_custom_plugin_trigger_code' with your actual trigger code.
$trigger_codes[] = 'my_custom_plugin_trigger_code';
$trigger_codes[] = 'another_custom_trigger';
return $trigger_codes;
}
add_filter( 'automator_mcp_webhook_trigger_codes', 'my_custom_automator_pro_webhook_triggers', 10, 1 );
?>
Placement
This code should be placed in the functions.php file of your active theme, a custom plugin, or using a code snippets plugin.
Source Code
uncanny-automator-pro/src/core/webhook/class-webhook-url-handler.php:183
private function get_webhook_trigger_codes(): array {
if ( null !== $this->cached_codes ) {
return $this->cached_codes;
}
$codes = array(
'WP_ANON_WEBHOOKS',
'ANON_ZAPIERWEBHOOKS',
'ANON_INTEGROMATWEBHOOKS',
'ANON_MAKEWEBHOOKS',
'ANON_INTEGRATELYWEBHOOKS',
'ANON_IFTTTWEBHOOKS',
'ANON_KONNECTZITWEBHOOKS',
'ANON_TYPEFORM_WEBHOOKS',
'ANON_THRIVECARTWEBHOOKS',
'ANON_OPTINMONSTERWEBHOOKS',
'ANON_GOOGLE_SHEETSWEBHOOKS',
);
/**
* Filter the list of trigger codes that receive auto-generated webhook URLs.
*
* Third-party integrations that register webhook triggers can add their
* trigger codes here so the MCP server returns the inbound URL on creation.
*
* @param string[] $codes Webhook trigger codes.
*/
$this->cached_codes = apply_filters( 'automator_mcp_webhook_trigger_codes', $codes );
return $this->cached_codes;
}