Customizing the post listings page requires an intricate mix of action and filter hooks to achieve the final goal. The first function we registered is associated with the variable filter name manage_edit-<post_type>_columns, where <post_type> is replaced with the internal post type name. When the registered function is called, it receives the default column list that will be shown while listing Book Reviews entries as an argument. Using this data, it proceeds to add three columns for author, rating, and type and removes the comments column from the array. Once finished, it returns the modified array.
The second part of the recipe registers the function that will be responsible for populating the new columns. Since this function gets called when any custom post type column is rendered, the code checks which column is currently requested before echoing the requested data to the browser. The function makes calls to get_the_ID() to get the index of the currently displayed row and to be able to find its associated data using get_post_meta and wp_get_post_terms.
At this point in the recipe, the new columns are visible in the Book Reviews management page and data is displayed for each of them. The purpose of the rest of the recipe is to make the author and rating columns sortable. This is done by first registering a function with the variable filter name manage_edit-<post_type>_sortable_columns, where <post_type> is replaced with the post type name. When the function is executed, it adds two items to the array of columns that will be sorted. This takes care of making the column header links that can be clicked for sorting, associated with the appropriate URLs.
The last function that is registered is associated with the request filter and takes care of adding elements to the query array based on the variables that came through in the query URL.
The final result allows administrators to easily reorder Book Reviews based on these two columns which can be sorted, as well as to see information about each entry's type.