WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to fire a wordpress hook programmatically? Specifically I'd like to have control of wp-insert-post.

share|improve this question
what do you mean by I'd like to have control of wp-insert-post.? – Eugene Manuilov Jun 8 '12 at 15:05
up vote 0 down vote accepted

To fire a hook you can use following functions:

  1. do_action - executes a hook created by add_action.
  2. do_action_ref_array - execute functions hooked on a specific action hook, specifying arguments in an array. This function is identical to do_action, but the arguments passed to the functions hooked to $tag are supplied using an array.

If you want to apply filters, you can do it by calling apply_filters function.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.