From the course: WordPress: Custom Post Types and Taxonomies
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Activating the REST API for your taxonomy - WordPress Tutorial
From the course: WordPress: Custom Post Types and Taxonomies
Activating the REST API for your taxonomy
- [Instructor] One of the options we haven't set yet is for the REST API. Aside from allowing our taxonomy data to be accessible from outside WordPress via an API, there's another crucial feature that the REST API turns on. And it's related to adding REST API support for our post type. If we look at the post edit screen for creating a new business, you'll notice on the right side bar our taxonomy is missing. That's because we haven't added REST API support. It's worth noting that our taxonomy would show up just fine in the classic editor. Basically, if you enable it for the post type you should also enable it for any related taxonomies. If we head over to the codex we can find the show_in_rest key which is false by default. Let's go ahead and copy that and go back to our code editor. In the args array we will paste that key and set it to true. Now, we'll save and if we go back to our WordPress dashboard and refresh the new business post edit screen you'll see the next size taxonomy…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
(Locked)
Building a basic custom taxonomy4m 14s
-
(Locked)
Creating an advanced custom taxonomy2m 50s
-
(Locked)
Activating the REST API for your taxonomy1m 17s
-
(Locked)
Adding taxonomy terms to your post types1m 43s
-
(Locked)
Challenge: Make location taxonomy1m 13s
-
(Locked)
Solution: Make location taxonomy3m 10s
-
(Locked)
-
-
-
-