Title: Trigger an external function
Last modified: May 26, 2020

---

# Trigger an external function

 *  [aserahangue](https://wordpress.org/support/users/aserahangue/)
 * (@aserahangue)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/wordpress-trigger-an-external-function/)
 * 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 5 years, 11 months ago by [Jan Dembowski](https://wordpress.org/support/users/jdembowski/).

Viewing 1 replies (of 1 total)

 *  [Joy](https://wordpress.org/support/users/joyously/)
 * (@joyously)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/wordpress-trigger-an-external-function/#post-12893682)
 * 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.

## Tags

 * [action](https://wordpress.org/support/topic-tag/action/)
 * [add](https://wordpress.org/support/topic-tag/add/)
 * [function](https://wordpress.org/support/topic-tag/function/)
 * [hook](https://wordpress.org/support/topic-tag/hook/)

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 1 reply
 * 2 participants
 * Last reply from: [Joy](https://wordpress.org/support/users/joyously/)
 * Last activity: [5 years, 11 months ago](https://wordpress.org/support/topic/wordpress-trigger-an-external-function/#post-12893682)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
