Demystifying Hooks, Actions and Filters
summary
Hooks are everywhere in WordPress: the speaker claims WordPress 4.9.5 contains 867 action calls and 43,050 filters, and shows concrete techniques: use do_action/apply_filters calls, remove_action to disable behavior, and attach callbacks with priority numbers to reorder execution. Examples include reordering WooCommerce template parts (price, title) via actions instead of editing templates, returning modified content via filters, debugging filters with var_export/error logs, and packaging reusable code into a small “functional plugin” so changes survive theme updates.
AI-written summary · about
chapters (14)
- 0:00Introduction to hooks and filters
- 1:51Actions vs filters explained
- 3:15Adding actions in WordPress
- 5:25Plugin loading and actions
- 7:51Core WordPress actions example
- 9:17Removing and reordering actions
- 11:06Modifying WooCommerce output
- 12:58How filters work metaphor
- 14:01Content filters in practice
- 15:46Advanced filter examples
- 16:50Debugging with filters
- 17:52Where to place your code
- 18:55Using functional plugins
- 20:00Q&A on filters and actions
