Is it possible to fire a wordpress hook programmatically? Specifically I'd like to have control of wp-insert-post.
1 Answer
To fire a hook you can use following functions:
do_action
- executes a hook created by add_action.do_action_ref_array
- execute functions hooked on a specific action hook, specifying arguments in an array. This function is identical todo_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.
I'd like to have control of wp-insert-post.
?