Let’s talk about what is the intent of variables, syntax, and naming standards. What is a variable? A variable is a symbol that represents data. It represents some value. It’s variable because you can change its value by reassigning it another value. For example, if you had a variable $post_id = 10;, you can change the value of the variable by doing $post_id = 20;. It’s the same variable, but you varied the value by assigning it a new value. Why is it a “symbol?” A symbol lets us define an alphanumeric symbol that we can read. It “represents” something […]
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 Introduction
This episode introduces you to PHP variables and this bootcamp. You will also find out what you need for this bootcamp, which includes the Non-WordPress Sandbox, which you will use throughout this bootcamp.
WordPress Tip: Do You Have to Specify all the Arguments for add_action and add_filter?
The question I often get is: If I only need a couple of the arguments that a filter or action makes available, do I have to specify all of them in the callback function for add_filter() and add_action(). For example, if a filter, such as shortcode_atts_{$shortcode} has 4 arguments, but I only need 3, do I have to wire it up for all 4? In this video, Tonya explains why you have control over what you want to receive by looking into WordPress core at apply_filters().
WordPress Tip – Match Arguments and Parameters When Calling Functions
You have to match the number of arguments to the number of required parameters for a PHP function. A common error is when you forget to specify the number of arguments to send when wiring up an event callback for add_action() or add_filter(). In this video, Tonya shows you why you have to specify this number.