You have the ability to get the taxonomies for a given post type. Using the object_type parameter, you can specify that you want to get all the taxonomies for whatever post type. For example, let’s say you want the ones for the Posts. You’d do:

Developing & Empowering WordPress Developers
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.
0 Videos Runtime
You have the ability to get the taxonomies for a given post type. Using the object_type parameter, you can specify that you want to get all the taxonomies for whatever post type. For example, let’s say you want the ones for the Posts. You’d do:
0 Videos Runtime
Let’s talk through what you’ve accomplished in the archive template episodes. You’ll add another FAQ too. Then let’s commit the changes to your GitHub repository. You’ve made a lot of changes. It’s time to commit them.
0 Videos Runtime
We need a way to categorize the content within the FAQs. Right? Categorization allows you to group the FAQs together for displaying them. For example, look at our Help Center. Each article is grouped and then displayed by a specific topic. We have Pre-Sales, Billing and Payments, and more. These topics are terms. These terms are bound to a custom taxonomy. Therefore, we want to build a custom taxonomy. Let’s call it “topic.”
0 Videos Runtime
Now we need to handle flushing the rewrites when our plugin is activated or deactivated. We covered this topic in the Flush Rewrite Rules of the Custom Post Type Basics lab. In that episode, I showed you why you never ever want to flush the rewrite rules after your register a custom post type. Where should we put the activation and deactivation callbacks? Hum. Let me show you a couple of different strategies. As this is a module, we’ll opt to add the callbacks within the module itself. Why? It keeps everything together when you reuse this module. Pop Quiz […]
0 Videos Runtime
Next, our custom post type needs further options to be configured, such as the menu icon and archive. Let’s walk through the different options.
0 Videos Runtime
Out-of-the-box, when you register a custom post type, the feature supports are title and editor. That’s it. Hum, what if there are additional supports that you want, such as SEO or other custom ones from other plugins? If you have the Genesis framework installed, then it adds 3 feature supports. If you are using Yoast SEO, then it adds 1 feature supports. How do you specify these features when you build your plugin? You use the configuration code that you wrote in Exclude Post Type Features episode, as part of the Custom Post Type Basics lab. That code is reusable […]
0 Videos Runtime
The arguments for registering a custom post type are configurable to customize the experience and implementation for your needs. Part of that configuration are the labels. The labels are in the back-end. By default, they will use ‘Post.’ Hum, that will not make sense for the user, content strategist, and anyone who is in the back-end adding, editing, or managing the content. Our job is not just to write code. Nope, you are building experiences. It’s our job to make sure what we build is self-documenting, user-friendly, and draws people in to want to use it. Configuring the labels customizes […]
0 Videos Runtime
Let’s build the basic FAQ custom post type. We need to simply register the post type with WordPress. You already did this task in the Custom Post Type Basics lab. Right? Therefore, you have the basic boilerplate code that you can reuse. Let’s copy the code from this lab, which you can find in this GitHub repository. Then we’ll adjust it for our needs. Let’s also talk about how to make this code work within the module, i.e. so that it’s reusable for the plugin that it’s embedded into it. How can we make the text domain reusable? Let’s talk […]
0 Videos Runtime
Let’s think about the architecture for this module. How are we going to break up the code into sub-modules, feature sets, and sub-functionality? In this episode, you and I are walking through how to break this module down into its components and keep it centered on a single intent or purpose. How do you break things up and architect your plugins, frameworks, applications, etc.? Focus on the intent and purpose. List out the big buckets of what you’re going to build. Then group the like items together into a logical order where each one supports the single intent of the […]
0 Videos Runtime
Way to go! You learned about the different post types and features that are built into WordPress Core. You saw how to check, add, and remove post type features. You saw an example with Genesis of how to add a new post type feature, one that is not built into Core. This lab will help you to do more in your own projects. It also serves as a baseline foundation for custom post types.
Know the Code flies on WP Engine. Check out the managed hosting solutions from WP Engine.
WordPress® and its related trademarks are registered trademarks of the WordPress Foundation. The Genesis framework and its related trademarks are registered trademarks of StudioPress.
This website is not affiliated with or sponsored by Automattic, Inc., the WordPress Foundation, or the WordPress® Open Source Project.