The Event (hook) Management System, which is part of the Plugin API, is a crucial component of WordPress. It is what allows you as a developer to extend, modify, and enhance the WordPress Core by hooking into the code when an event fires. It allows you to interact with it and each other’s custom plugins and themes. Understanding this component and each of the constructs available within it is essential for you to successfully build custom websites. In this hands-on lab, you will learn about the Plugin API, Event Management System within it, and the hook registration process.
What You Will Learn
In this lab, you will learn:
- What hooks are and why they exist
- Difference between an action and filter hook event
- How callbacks are registered
- Why the priority level is important
- Getting some arguments back to work with
In order to do this lab, you will need your local sandbox site spun up and ready to go. See this Help Center article to get your sandbox ready.
These Docx will help you as you go through the WordPress source code:
Keep It Simple, Stupid (KISS) - the best kiss you'll get in code.
Total Lab Runtime: 01:17:56
- 1 What is the Event Management System?free 13:16
- 2 The Difference Between Action & Filterbasic 09:11
- 3 Introducing Filter Eventbasic 10:53
- 4 WordPress Event Lookup Tablebasic 09:00
- 5 WordPress Event Priority Levelbasic 08:21
- 6 Number of Arguments to Pass to the Callbackbasic 10:56
- 7 PHP Argument Lookup Tablepro 09:11
- 8 Let's Look at add_filter in Corepro 07:08
WordPress auto discovers the main plugin file for each plugin and then loads it. How does it do this? How does it know which file is the main one in your plugin directory? In this Pro Lab, you'll go into WordPress Core, walk through the code, and then reverse engineer it. This lab will help you to know how your plugin files are being read, discovered, and loaded.
Check out the WordPress Fundamentals Library for more hands-on labs, insights, Docx, and more.
Check out the series page for more labs: WordPress Event-Driven (Hook) Engine