Steps for extending theme-specific hooks

Now, you should have a brief understanding of built-in hooks in themes, as well as theme-specific hooks. Let's take a look at the basic steps for customizing themes using these hooks:

  1. Execute a directory search on the theme and identify the hooks by tracking the apply_filters and do_action functions.
  2. For the filters, check whether more than two parameters have been passed to the apply_filters function. The second parameter will be the variable you will be filtering, and additional parameters will be used to support the filtering process.
  3. If the apply_filters function contains two parameters, you can implement it by using following code:
 add_filter( 'filter_hook_name', 'filter_implementation_function_name' ...

Get WordPress Development Quick Start Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.