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 Reviews
system that we have been putting in place so far in this chapter, a type of categorization that would be helpful is a book type (for example, Science Fiction, Documentary, Fiction, Poetry, and so on).
This recipe shows how to create a new category (known as a taxonomy in the WordPress backend) and associate it with the Book Review custom post type.
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 in your development site. Alternatively, you can get the resulting code (Chapter 4/ch4-book-reviews/ch4-book-reviews-v4.php
) from the downloaded code bundle and rename the file ch4-book-reviews.php
.