do_action and hook methods
Your analogy here is partially correct, but incomplete: I understand that when do_action is called wp looks for all registered listeners and invokes them according set priority. You need to consider what happens when you call add_action. WordPress never searches for the add_action statements, it has those in a list. When you call add_action, it … Read more