Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Book Type Taxonomy

// Register Custom Taxonomy
function register_book_type() {

	$labels = array(
		'name'                       => _x( 'Book Types', 'Taxonomy General Name', 'thales' ),
		'singular_name'              => _x( 'Book Type', 'Taxonomy Singular Name', 'thales' ),
		'menu_name'                  => __( 'Book Type', 'thales' ),
		'all_items'                  => __( 'All Book Types', 'thales' ),
		'parent_item'                => __( 'Parent Book Type', 'thales' ),
		'parent_item_colon'          => __( 'Parent Book Type:', 'thales' ),
		'new_item_name'              => __( 'New Book Type Name', 'thales' ),
		'add_new_item'               => __( 'Add New Book Type', 'thales' ),
		'edit_item'                  => __( 'Edit Book Type', 'thales' ),
		'update_item'                => __( 'Update Book Type', 'thales' ),
		'view_item'                  => __( 'View Book Type', 'thales' ),
		'separate_items_with_commas' => __( 'Separate Book Types with commas', 'thales' ),
		'add_or_remove_items'        => __( 'Add or remove Book Types', 'thales' ),
		'choose_from_most_used'      => __( 'Choose from the most used', 'thales' ),
		'popular_items'              => __( 'Popular Book Types', 'thales' ),
		'search_items'               => __( 'Search Book Types', 'thales' ),
		'not_found'                  => __( 'Not Found', 'thales' ),
		'no_terms'                   => __( 'No Book Types', 'thales' ),
		'items_list'                 => __( 'Book Types list', 'thales' ),
		'items_list_navigation'      => __( 'Book Types list navigation', 'thales' ),
	);
	$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_type', array( 'book' ), $args );

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