I am trying to find what exactly do_action and add_action works. I already examine with add_action but for do_action i am trying as new now. This what i tried.
Actually, the add_action
is an action hook which is used to invoke an action (a registered handler) on a certain point depending on the action and the do_action
is used to manually invoke that registered action. For example:
add_action('some_hook', 'handler_for_some_hook');
This handler will be invoked when you take or the script does the some_action
but if you want you may invoke that action manually using the do_action
. So, basically the do_action
invokes the registered action hook when you call it. Check more on Codex.