The Event System in WordPress Plugin API is the cornerstone for developers, as it allows you to extend, enhance, and change the behavior of WordPress. In this lab, you will be introduced to the event-driven mechanism. Then you’ll get to work registering callbacks for events (actions and filters) to help you know this important API. Let’s dig into add_filter and add_action.
Labs
Labs are hands-on coding projects that you build along with Tonya as she explains the code, concepts, and thought processes behind it. You can use the labs to further your code knowledge or to use right in your projects. Each lab ties into the Docx to ensure you have the information you need.
Each lab is designed to further your understanding and mastery of code. You learn more about how to think about its construction, quality, maintainability, programmatic and logical thought, and problem-solving. While you may be building a specific thing, Tonya presents the why of it to make it adaptable far beyond that specific implementation, thereby giving you the means to make it your own, in any context.
PHP Variables Bootcamp
In order to be proficient in PHP, you need to first know variables. It’s learn and do time. In this lab, you are focusing on user-defined variables, the data they represent, how they are passed and assigned into function parameters’ list, naming, and their scope. For Pro members, you learn more about the PHP internals, how variables are linked to their data, and how memory moves around under the hood.
Type Juggling
PHP does Type Juggling and determines the data type of the variable based upon its context. You can learn more about PHP Type Juggling in the Docx.
Variable Scope When Including Files
Let’s see what happens when you include files into another file. What happens with the variables between the files? In this episode, you will write code to include a view into a function and then access the variables between the files.
Namespacing
Let’s see how namespacing affects variables.
Passing Variables By Reference – PHP Internals
Now you’ve seen passing by reference in action. Let’s dive into how PHP manages it. You’re going into the PHP interpreter and its C language code.
Passing Variables By Reference
Let’s dive into passing data by reference. By reference allows you to work with the same data between different variables. This means you can change the data and it is changed in both variables. You will build some code to test this concept and see how it works. Then you and I will talk about when to use it.
Static Variables – PHP Internals
Let’s see how static variables retain their data within PHP internals.
Static Variables
Static variables retain their data even after the function gets done running. Then the next time you call it, it remembers the data it had from before because it is retained and persistent for the life of the web page request. Statics offer you an option instead of using global variables. Let’s take a look at how you can pass memory around in procedural coding without using globals. In this video, you will write code to show how the static and non-static variable work. You’ll build a for loop and then call two separate functions.
Global Variables – PHP Internals
Let’s look at how PHP manages global variables and provides the scope. You’ll look again at memory.