Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

book_category

book_category

// Register Custom Taxonomy
function book_category() {

	$labels = array(
		'name'                       => _x( 'Book Categories', 'Taxonomy General Name', 'btc' ),
		'singular_name'              => _x( 'Book Category', 'Taxonomy Singular Name', 'btc' ),
		'menu_name'                  => __( 'Book Categories', 'btc' ),
		'all_items'                  => __( 'All Categories', 'btc' ),
		'parent_item'                => __( 'Parent Category', 'btc' ),
		'parent_item_colon'          => __( 'Parent category', 'btc' ),
		'new_item_name'              => __( 'New Book Category Name', 'btc' ),
		'add_new_item'               => __( 'Add New Book Category', 'btc' ),
		'edit_item'                  => __( 'Edit Book Category', 'btc' ),
		'update_item'                => __( 'Update Book Category', 'btc' ),
		'view_item'                  => __( 'View Book Category', 'btc' ),
		'separate_items_with_commas' => __( 'Separate Book Categories with commas', 'btc' ),
		'add_or_remove_items'        => __( 'Add or remove Book Category', 'btc' ),
		'choose_from_most_used'      => __( 'Choose from the most used', 'btc' ),
		'popular_items'              => __( 'Popular Book Category', 'btc' ),
		'search_items'               => __( 'Search Book Categories', 'btc' ),
		'not_found'                  => __( 'Not Found', 'btc' ),
		'no_terms'                   => __( 'No items', 'btc' ),
		'items_list'                 => __( 'Items list', 'btc' ),
		'items_list_navigation'      => __( 'Items list navigation', 'btc' ),
	);
	$args = array(
		'labels'                     => $labels,
		'hierarchical'               => true,
		'public'                     => true,
		'show_ui'                    => true,
		'show_admin_column'          => true,
		'show_in_nav_menus'          => true,
		'show_tagcloud'              => true,
	);
	register_taxonomy( 'book_category', array( 'book' ), $args );

}
add_action( 'init', 'book_category', 0 );