- Navigate to the WordPress plugin directory of your development installation.
- Create a new directory called ch4-book-reviews.
- Navigate to this directory and create a new text file called ch4-book-reviews.php.
- Open the new file in a code editor and add an appropriate header at the top of the plugin file, naming the plugin Chapter 4 - Book Reviews.
- Add the following line of code to register a function that will be executed during the initialization phase every time WordPress generates a page:
add_action( 'init', 'ch4_br_create_book_post_type' );
- Add the following code block to provide an implementation for the ch4_br_create_book_post_type function:
function ch4_br_create_book_post_type() { register_post_type( 'book_reviews', ...