Complete the code to register a custom post type with the label 'Books'.
register_post_type('book', array('label' => [1]));
The 'label' argument should be a human-readable name like 'Books' for the custom post type.
Complete the code to make the custom post type publicly queryable.
register_post_type('movie', array('public' => [1]));
The 'public' argument should be set to the boolean true (without quotes) to make the post type publicly queryable.
Fix the error in the code to enable the post type to support the editor and thumbnail features.
register_post_type('album', array('supports' => array([1])));
The 'supports' argument must be an array of strings. Here, it should include 'editor' and 'thumbnail' to enable those features.
Fill both blanks to register a custom post type that is hierarchical and has a custom menu icon.
register_post_type('product', array('hierarchical' => [1], 'menu_icon' => [2]));
Setting 'hierarchical' to true allows parent-child relationships. The 'menu_icon' uses a dashicon string like 'dashicons-cart'.
Fill all three blanks to register a custom post type with a custom rewrite slug, showing it in REST API, and enabling archive pages.
register_post_type('event', array('rewrite' => array('slug' => [1]), 'show_in_rest' => [2], 'has_archive' => [3]));
The 'rewrite' slug should be a string like 'events'. 'show_in_rest' and 'has_archive' are booleans set to true to enable REST API and archive pages.