Changing the webhook URL
-
I have a site that uses that same form an multiple pages, however, on some pages I need to change the webhook URL depending on the form data. I’m sorry if this is available already and I missed it, but I haven’t been able to find it yet.
It would be great if there was a filter for the $hook_url variable added to the ‘pull_the_trigger’ method after the
$args
variable. Something like:$hook_url = apply_filters( 'ctz_hook_url', $hook_url, $data );
This would help us use the
$data
to possibly change the hook URL.However, since there is no filter right now, I am left to try to remove your
pull_the_trigger
function from thectz_trigger_webhook
action but I am having a hard time doing that. I’m an intermediate PHP developer in terms of OO stuff. Here’s what I’ve tried below. Is there any documentation on removing your function from that action?function sl9_location_cf7_webhook_init() { remove_action( 'ctz_trigger_webhook', array( 'CFTZ_Module_Zapier', 'pull_the_trigger' ), 10, 2 ); } add_action( 'plugins_loaded', 'sl9_location_cf7_webhook_init', 20 );
function sl9_location_cf7_webhook_init() { global $ctz_core; $ctz_zapier = new CFTZ_Module_Zapier( $ctz_core ); remove_action( 'ctz_trigger_webhook', array( $ctz_zapier, 'pull_the_trigger' ), 10, 2 ); } add_action( 'plugins_loaded', 'sl9_location_cf7_webhook_init', 20 );
Has anyone successfully removed your native/default action from within their template before? Could you possibly provide examples?
- The topic ‘Changing the webhook URL’ is closed to new replies.