Adding custom categories for custom post types
To keep items organized on a site, administrators often use the built-in WordPress categories and terms to identify similar items. Looking back at the book review system that we have been putting in place so far in this chapter, a type of categorization that would be helpful to add is a book type (for example, science fiction, documentary, fiction, and poetry).
You should have already followed the Displaying custom post type data in shortcodes recipe to have a starting point for this recipe, and the resulting plugin should still be active on your development site. Alternatively, you can get the resulting code (
ch4/ch4-book-reviews/ch4-book-reviews-v5.php) from the book's GitHub page and rename the file
How to do it...
- Navigate to the...