Let’s do an overview of the web page, from its web request and back out to the browser. You will see the order (or sequence) of how the web request is processed, in a big picture view, including how the theme’s functions.php file and template are called.
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.
The Why of the Genesis Framework
Genesis is my theming framework of choice because it is built for the developer. It allows you to customize everything without having to rewrite large sections of code or recreate template HTML structures. It is modular and complies, for the most part, to clean, quality coding standards and concepts. It is easy to read the codebase, which helps you to find what you need and then get on to writing the custom bits. Let’s talk about the why of the Genesis framework from the professional developer’s perspective.
Lab Introduction
Let me introduce the lab to you to what you will be doing. First of all, this lab is meant for the professional developer, the person who wants to know the Genesis codebase, as you will be exploring and reverse engineering the actual source code. The intent of this lab is to introduce you to the Genesis framework, its architecture, event hooks (actions and filters), the child-parent relationship, and more. You will look at the HTML and markup that is generated by the framework, explore the hooks that allow you to customize everything, and get a solid foundation before you […]
Let’s Build a Blog Intro Custom Plugin
Out-of-the-box WordPress does not provide a way to introduce the Posts Page (Blog), as the editor is turned off and there is no automatic rendering of the content before the posts. In this lab, you will build a Blog Intro real-world, custom plugin which provides an introduction or welcome feature for your clients. As you build this plugin, you are learning about fetching content from the database, sanitizing, the Genesis framework, views, and more.
Remove Genesis Page Title
In this episode, you will unregister the Genesis page title. Remember, you need to unregister it after it has been registered. Huh, what does that mean? It means after the theme is called. In this episode, you will learn about how to unregister callbacks and the WordPress event after_setup_theme. WordPress Events (Hooks) Psst, events, unregistering, and registering is fuzzy for you, make sure you take the Introduction & Registering Events hands-on lab. [/infoxbox]
Building the HTML View File
It’s time to build out the HTML structure and put it into the view. What is a view? Why do you want to use it? Let’s talk about the qualities of clean, quality code. You will also learn about how to load the view as well as the variable scope. To learn more about variable scope and including files, go to the PHP Variables Bootcamp.
Prepare the Contents for the Browser
Let’s finish preparing the content for rendering out to the browser. How about if there are shortcodes in the code? How do we process those? How about using auto-formatting the paragraph HTML elements? In this episode, you will add in the do_shortcode and then wpautop.
Sanitize with get_post
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.
Sanitize the Contents
Anything out of the database is not safe. It has to be sanitized before it is rendered out to the browser. Let’s talk about how to sanitize and which sanitizing function to use for the plugin. In this episode, you will see some nefarious code in action. Then you’ll try out two different sanitizing functions: esc_html wp_kses_post
Let’s Look in Core at get_post
– Part 2
This episode continues reverse engineering get_post in WordPress Core. Now that you understand the database, or at least have a basic understanding of it and SQL, you will continue looking at get_post. You’ll see how each column in the database populates a property in the object that you get back when calling this function.