From the course: WordPress: Custom Post Types and Taxonomies

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Activating the REST API for your taxonomy

Activating the REST API for your taxonomy - WordPress Tutorial

From the course: WordPress: Custom Post Types and Taxonomies

Start my 1-month free trial

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…

Contents