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

  1.  Action Hook
  2.  Filter Hook

Action & Filter Hook:

Difference between hook given below

S.No.Action HookFilter Hook
1Execute custom functionsModify or filter data
2Does not return a valueReturns modified data
3Perform tasks, add functionalityModify content, alter data
4Running code on page loadChanging text before display
5has_action()
do_action()
add_action()
remove_action() etc
has_filter()
doing_filter()
add_filter()
remove_filter() etc