The next step is to evaluate all of the contributing factors in order to determine where to start testing. Ok. It requires first that we figure out how the code is working, or how we think it’s working. In this episode, I’ll walk you through the process, explain the code, and give you a refresher on the event registry system that the WordPress Plugin API provides. Now if you haven’t already gone through the event registry videos, you need to do that now. Here are the links to get you up to speed. Please note: It is vital that you […]
The first step in my four-step problem-solving process is to identify the expected versus actual behavior. You simply write down everything that you see which is different from what is working versus what is not working, as well as what you expected to occur versus what actually occurred. It’s literally a process of pulling out your notebook and writing down the differences. Even the most minute detail needs to be recorded. Why? Because it may be a clue to help you find, understand, and resolve the true root cause. In this episode, you and I will walk through this process […]
Let me introduce you to the lab and what you will be doing. This lab starts with a broken website as some wonky, unexpected behavior is happening. You will be walking through the problem-solving process of how to identify the root cause, why it’s happening, and then how to resolve it…properly. In doing so, you will dive into the Genesis framework and WordPress’ Plugin API.
Hey not a member? That’s ok. Here’s the free video that tells you what is wrong and provides a brief explanation as to why. Porter originally asked me the question. This video addresses his question and uses his example to explain why the problem is occurring.
Genesis gives us the means to fully customize it because it utilizes the event system available from the WordPress Plugin API. Throughout the codebase, you unregister events to remove a component, register your callback to change something, or re-register an event to change its order or location. You need a solid understanding of the Event Registry system in order to customize Genesis. Let’s do a refresher here. You can accelerate your proficiency with the Plugin API using these video-based Docx as they thoroughly walk you through each construct: add_action remove_action add_filter remove_filter do_action apply_filters
Let’s go into WordPress Core to understand if we can use get_post to sanitize fields when in display filter mode. You will reverse engineer Core to discover for yourself. You will use has_filter to see if there is a filter event that does the sanitizing for the data post_content. You’ll also learn about foreach.
Let’s go deeper to understand what happens when arguments are passed to a function. How does PHP manage them? If you pass more arguments than a function needs, what happens? How do you access them? The following PHP constructs were presented to you in this video: func_get_arg and func_get_args.
The last parameter for registering your callback to the event is the number of arguments. It specifies the number of arguments your callback wants to receive. You will learn about the difference between required and optional parameters in PHP. You’ll see what happens when you send too few and too many arguments to your callback.
Let’s see what the priority level parameter does. How does it affect the order of code execution (i.e. when code is called and works)? With a filter, what is the order to changing the value that is passed to each of the callbacks?
You will meet the WordPress Event Lookup Table, which holds all of the events. Yup, it holds both the filters and actions all in one event lookup table. In this video, you will look at the actual table and we’ll discuss how it is structured including the event name, priority, callbacks, and the number of arguments.