In Wordpress development hooks are used for action & Filter.
Hooks are used to extend and customize WordPress functionality without directly modifying the core code.
Wordpress provide two type of hooks
- Action Hook
- Filter Hook
Action & Filter Hook:
Difference between hook given below
| S.No. | Action Hook | Filter Hook |
| 1 | Execute custom functions | Modify or filter data |
| 2 | Does not return a value | Returns modified data |
| 3 | Perform tasks, add functionality | Modify content, alter data |
| 4 | Running code on page load | Changing text before display |
| 5 | has_action() do_action() add_action() remove_action() etc | has_filter() doing_filter() add_filter() remove_filter() etc |