Building on its history of openness and ease of use, WordPress reached new heights in customization when it introduced custom post types.
Custom post types are new categories of items that are created by using the WordPress API and that appear in the WordPress administration interface as complete new sections, next to the default Posts and Pages sections. These custom items can be used to store any type of information, including events, bug reports, recipes, movie reviews, and many more.
When using custom post types to implement this kind of functionality, developers are able to take advantage of WordPress internal content editing capabilities, including its powerful text editor and user-friendly media uploader. Custom post types also simplify data management for developers, since all of the information related to these new entries is stored in the site database using the existing table structures. Finally, custom post types can leverage the established theme and template system to display the information that site administrators store in these new content types.
If you have ever taken a peek at the MySQL database behind a WordPress site, you know that posts, pages, attachments, revisions, and navigation menu items share the same tables. In essence, all of these data elements are custom post types, with some of them using the standard text editor, while others, such as the navigation menus, have a custom management interface. Each of these types of items also has a different mechanism to be displayed on a site.
Using custom post types opens up endless possibilities to tailor the functionality of a WordPress installation and provide a custom solution to end users without needing to invest a large amount of time re-inventing the wheel. This chapter covers all facets of creating custom post types through the creation of a Book Review system, including the creation of new types of elements, displaying the newly stored information on the website, and customizing the environment to create an editor with unique capabilities.