// Register Custom Taxonomy function booklib_custom_taxonomy() { $labels = array( 'name' => _x( 'Categories', 'Taxonomy General Name', 'booklib' ), 'singular_name' => _x( 'Category', 'Taxonomy Singular Name', 'booklib' ), 'menu_name' => __( 'Categories', 'booklib' ), 'all_items' => __( 'All Categories', 'booklib' ), 'parent_item' => __( 'Parent Category', 'booklib' ), 'parent_item_colon' => __( 'Parent Item:', 'booklib' ), 'new_item_name' => __( 'New Category', 'booklib' ), 'add_new_item' => __( 'Add New Category', 'booklib' ), 'edit_item' => __( 'Edit Category', 'booklib' ), 'update_item' => __( 'Update Category', 'booklib' ), 'view_item' => __( 'View Category', 'booklib' ), 'separate_items_with_commas' => __( 'Separate Categories with commas', 'booklib' ), 'add_or_remove_items' => __( 'Add or remove Categories', 'booklib' ), 'choose_from_most_used' => __( 'Choose from the most used', 'booklib' ), 'popular_items' => __( 'Popular Categories', 'booklib' ), 'search_items' => __( 'Search Categories', 'booklib' ), 'not_found' => __( 'Not Found', 'booklib' ), 'no_terms' => __( 'No Categories', 'booklib' ), 'items_list' => __( 'Categories list', 'booklib' ), 'items_list_navigation' => __( 'Categories list navigation', 'booklib' ), ); $args = array( 'labels' => $labels, 'hierarchical' => true, 'public' => true, 'show_ui' => true, 'show_admin_column' => true, 'show_in_nav_menus' => true, 'show_tagcloud' => false, 'show_in_rest' => true, ); register_taxonomy( 'book_category', array( 'book' ), $args ); } add_action( 'init', 'booklib_custom_taxonomy', 0 );