• Hello,

    Working on WordPress, I would like to trigger my function when another plugin triggers its own through the tag used for its hook.

    Use add_action (their_tag, my_function) OK why not, but during the execution of their code, WordPress does not see my function because it is located elsewhere, logical.

    How can I do ?

    Thanks in advance !

    • This topic was modified 4 years, 9 months ago by Jan Dembowski.
Viewing 1 replies (of 1 total)
  • You have the right concept, but maybe that plugin isn’t using a hook, or did you get the hook name wrong?

    Did you get an error? Or did your code not run?
    For your code to be called, either WP or another plugin has to call do_action for the hook name that you used. And you have to have your add_action before the do_action.

Viewing 1 replies (of 1 total)
  • The topic ‘Trigger an external function’ is closed to new replies.