What is a Filter?
Filters are a type of “hook” in WordPress. Hooks are built-in functions that enable pieces of code to interact with one another. Filters enable you to modify data while running plugins and themes.
More About Filters
To add a filter, you need to create a callback function that will run when the filter runs. This callback function needs to be part of a hook that will call it.
There are additional parameters that you can use with WordPress filters. To learn more about filter parameters, we recommend that you check out the official WordPress Developer Handbook.