What does do_action() function do in wordpress? [duplicate]

Check out the WordPress Codex Krishan: do_action

I quote from that codex page

Execute functions hooked on a specific action hook.

This function invokes all functions attached to action hook $tag. It is possible to create new action hooks by simply calling this function, specifying the name of the new hook using the $tag parameter. You can pass extra arguments to the hooks, much like you can with apply_filters(). This function works similar to apply_filters() with the exception that nothing is returned and only the functions or methods are called.

You can hook a function to an action hook using add_action().

Leave a Comment