Adding filters for custom categories to the custom post list page
A second customization method for the custom post listings is to create a drop-down box that will allow administrators to only display items that belong to a single category at a time. This can help significantly reduce the number of entries that are shown to quickly find the desired content.
Getting ready
You should have already followed the Displaying additional columns in the custom post list page 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-v9.php
) from the book's GitHub page and rename the file ch4-book-reviews.php
.
How to do it...
Follow these steps to add a filter mechanism based on the book review type to the listings page:
- Navigate to the
ch4-book-reviews
folder of the WordPressplugins
directory of your development installation...