This entry is part 5 of 14 in the Plugin Development 101 Series
- Introduction to WordPress Plugin Development 101
- Plugin Development 101 – What Makes a Plugin?
- Plugin Development 101 – General Best Practices
- Plugin Development 101 – An Intro to Filters
- Plugin Development 101 – Intro to Actions
- Plugin Development 101 – Registering a Custom Post Type
- Plugin Development 101 – Intro to Short Codes
- Plugin Development 101 – Intro to Loading Scripts and Styles
- Plugin Development 101 – Introduction to Adding Dashboard Menus
- Plugin Development 101 – Separating Your Plugin into Multiple Files
- Plugin Development 101 – Your First OOP Plugin
- Plugin Development 101 – Dissecting the Featured Comments Plugin
- Plugin Development 101 – Digging Into WordPress Core to Solve a Problem
- Plugin Development 101 – Introduction to extending classes
In this part of Plugin Development 101 we take a look at another of the most important tools plugin developers use every day: actions. Just like filters, the presence of actions throughout WordPress are one of the elements that make plugin development possible, so having a good understanding of what they are and how they work is extremely important.
Actions are a method in WordPress that allows developers to “hook” into points an execute code. For example, when a post is published in WordPress there is a hook that can be used to trigger additional functions that you want to execute at the same time, perhaps to send an email notification of the new post.
I will leave the extended explanation of actions to the video, but here are a few links that help to illustrate what actions are and how to use them:
9 thoughts so far
Have your say
Hi Pippin! Why this post is not in the “Plugin Development 101” series?
I mean, in the series navigation bar, it goes from “Intro to filters” to “Registering a Custom Post Type”. This post should be the 5th entry, shouldn’t it?
Whoops! Looks like it got accidentally removed.
Now it’s fine! BTW, great series!
And by the way… why the post ID was not the ID of the post?
I’m not sure what you mean by this.
In 7:10 you display $post_id and it does not match the ID on the URL when editing the post.
Just wondering why…
That’s because the post ID displayed was the ID of a revision, not the main post object.
Of course! Thanks so much. That was killing me! 😀
Comments are closed.
Leave a reply
Join the discussion