• Resolved shorelinechrism

    (@shorelinechrism)


    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 the ctz_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?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Mário Valney

    (@mariovalney)

    Hello. How are you?

    I guess the best way is to provide a filter for developers.
    Unhappy I’m not able to push this enhancement now, but you can make a PR if you want/can.

    If not, I think I’ll be able to add this until the end of week.

    Thanks

    Thread Starter shorelinechrism

    (@shorelinechrism)

    Sure thing. Should I do it on the gihub repo?

    Plugin Author Mário Valney

    (@mariovalney)

    Yes, please.

    Already there is some action, so I guess we can do the same way.

    Plugin Author Mário Valney

    (@mariovalney)

    I’m sorry for taking so time.

    It’s going to be published a new version tonight.
    Thanks for your contributon.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Changing the webhook URL’ is closed to new replies.