Quantcast
Channel: Collins Agbonghama – SitePoint
Viewing all articles
Browse latest Browse all 19

Demystifying the WordPress Hook System

$
0
0

If you've been developing websites with WordPress (including plugin and theme development) chances are you’ve heard these terms: Hooks, Actions, and Filters. These are part of the Event-driven Architecture Pattern, which WordPress uses.

Are you new to WordPress development or finding it difficult to understand the basic concepts? I can’t recommend highly enough Simon Codrington’s Introduction to WordPress Plugin Development tutorial. He did a great job of explaining Actions, and Filters.

In this tutorial, I'll be demystifying the WordPress hook system, leaving no stone unturned. Without further ado, let’s get started.

Hooks, Actions, Filters. What Are They?

'Hooks' are basically events triggered by WordPress core, themes and plugins at various stages of their execution or interpretation by PHP. When these events are triggered, all the functions and/or class methods hooked or attached to them are executed in their correct order.

Hooks come in two forms, Actions and Filters. While the former is used to add and remove features or functionalities at various stages of execution process, the latter modifies the behavior of various features and implementations. Don’t worry if you still don’t understand. You will when we start seeing some code examples below.

Continue reading %Demystifying the WordPress Hook System%


Viewing all articles
Browse latest Browse all 19

Trending Articles