WordPress actions, hooks and filters (Definitive guide)


Introduction I have been using WordPress for many years – all the way back to version 2.0 in 2005. A key breakthrough for me, in terms of being a WordPress developer, was when I finally fully understood how to edit the behaviour of WordPress and plugins and themes using hooks.
I hope by reading this post that you will come away with a better understanding of what actions are, how they are used and how you can use them to extend WordPress and of course your own plugins and themes.
Video: Using a filter in WordPress
Before I get into the details of this post, I thought it would be a good idea to show you a hook in use. This video is a demonstration of using a hook in WordPress to modify the output of the tag cloud widget.
Hooks are a way for one piece of code to interact/modify another piece of code.
What are WordPress hooks and how do they work?
Hooks are what WordPress uses to allow one piece of code to interact with and/or modify another piece of code. For example, a plugin could modify another piece of code which WordPress runs. WordPress also makes extensive use of hooks to modify its own code.
Hooks are named events (such as save_post) to which developers can attach functions.
Source: https://managewp.org/articles/18266/wordpress-actions-hooks-and-filters-definitive-guide



source https://williechiu40.wordpress.com/2019/01/07/wordpress-actions-hooks-and-filters-definitive-guide/