Unlock your potential with a Pro Membership
Here is where you propel your career forward. Come join us today. Learn more.
Get the Registered Taxonomies
Lab: WordPress Built-in Taxonomy Basics
Video Runtime: 15:35
There will be times when you need to grab all the registered taxonomies. Using the WordPress construct get_taxonomies(), you can specify what you want. For example, you fetch all of the custom taxonomies, built-in ones, or all of them. In this episode, you’ll work with this instruction and go into WordPress core to see what it does for you.
Using the get_taxonomies()
, you and I can dive deeper into the configuration of each of the built-in taxonomies. Let’s build some code and then see the different options and explore the built-ins. You’ll discover that there are 5 different built-in taxonomies out-of-the-box with WordPress:
- category
- post_tag
- nav_menu
- link_category
- post_format
You and I will look at the configuration of each of these.
Menu Taxonomy and Terms
You’ll discover that the Navigation Menu is a taxonomy, the specific menu that you create in the WordPress back-end is a term, and the individual menu item is a post. Did I just blow your mind?
Get Built-in Only, Custom Taxonomies, or All of Them
The _builtin
parameter lets you specify whether you want to receive all of the taxonomies, only the built-in ones, or only the custom ones. You configure it like this:
- All Taxonomies – don’t include the
_builtin
parameter - Built-in Only:
'_builtin' => true
- Custom Only:
'_builtin' => false
-
Want the code used in this episode?
Who needs copy/paste? Right. Writing code from scratch is fun!
Episodes
Total Lab Runtime: 01:17:16
- 1 Lab Introductionfree 02:17
- 2 What is a Taxonomy?free 10:12
- 3 What are Terms?free 08:53
- 4 Relationship Between Post, Taxonomy, & Termspro 14:22
- 5 Get the Registered Taxonomiespro 15:35
- 6 Dive into WordPress Corepro 03:17
- 7 Get the Terms for a Taxonomypro 08:19
- 8 Get the Taxonomies for a Post Typepro 02:50
- 9 Archive for Taxonomy or Termpro 04:14
- 10 Explore Other Functionspro 07:17