Filter Hooks
Filter hooks are used to manipulate output. An example of this would be to add a line or text (or a hyperlink, or a signature sign-off—whatever you’d like) to the end of the content of each of your blog posts. Filter hooks can also be used for truncating text, changing formatting of content, or just about any other programming manipulation requirement (for example, adding to or overriding an array of values).
<?php add_filter( $tag, $function_to_add, $priority, $accepted_args ); ?>
Just like an action hook, we take the same procedure to execute a filter hook. There’s 4 parameters. The first one is what we want to hook into. The 2nd parameter is the function we want to call when this hook is triggered. The 3rd is priority. The 4th parameter tells how many arguments the function is going to take in. By default, the amount of accepted arguments is 1 because WordPress filter hooks passes at 1 least variable into our function.