From the course: WordPress: Action and Filter Hooks

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Action hooks explained

Action hooks explained - WordPress Tutorial

From the course: WordPress: Action and Filter Hooks

Start my 1-month free trial

Action hooks explained

- [Instructor] So far, we've learned that WordPress hooks come in two flavors, action hooks and filter hooks. Or you might just hear them referred to as action and filters, or even just hooks. In this lesson, we're going to take a look specifically at action hooks, what they are and how we can use them. Back over in the plugin API documentation in the codex, you can see that there are functions that relate specifically to filters and actions. I want to highlight the most common actions that you'll see here. We've got has_action, which checks to see if any action has been registered for a particular hook. We've got add_action, which lets us hook a function onto a specific action. Do_action, which lets you, basically, drop a bookmark in the code where you can come back and hook actions to it later. And the other one I want to point out is this remove_action. As you might suspect, it does the exact opposite of add_action, so…

Contents