In WordPress, a Filter is a function that is associated with an existing Action by specifying any existing Hook.
Developers can create custom Filters using the Filter API to replace code from an existing Action. This process is called “hooking”.
Custom Filters differ from custom Actions because custom Actions allow you to add or remove code from existing Actions. Whereas custom Filters allow you to replace specific data (such as a variable) found within an existing Action.