Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Publication Date (tags)

// Register Custom Taxonomy
function publication_date() {

	$labels = array(
		'name'                       => _x( 'Publication Dates', 'Taxonomy General Name', 'eggcup-library-catalogue' ),
		'singular_name'              => _x( 'Publication Date', 'Taxonomy Singular Name', 'eggcup-library-catalogue' ),
		'menu_name'                  => __( 'Publication Date', 'eggcup-library-catalogue' ),
		'all_items'                  => __( 'All Publication Dates', 'eggcup-library-catalogue' ),
		'parent_item'                => __( 'Parent Publication Date', 'eggcup-library-catalogue' ),
		'parent_item_colon'          => __( 'Parent Publication Date:', 'eggcup-library-catalogue' ),
		'new_item_name'              => __( 'New Publication Date Name', 'eggcup-library-catalogue' ),
		'add_new_item'               => __( 'Add New Publication Date', 'eggcup-library-catalogue' ),
		'edit_item'                  => __( 'Edit Publication Date', 'eggcup-library-catalogue' ),
		'update_item'                => __( 'Update Publication Date', 'eggcup-library-catalogue' ),
		'separate_items_with_commas' => __( 'Separate Publication Dates with commas', 'eggcup-library-catalogue' ),
		'search_items'               => __( 'Search Publication Dates', 'eggcup-library-catalogue' ),
		'add_or_remove_items'        => __( 'Add or remove Publication Dates', 'eggcup-library-catalogue' ),
		'choose_from_most_used'      => __( 'Choose from the most used Publication Dates', 'eggcup-library-catalogue' ),
		'not_found'                  => __( 'Not Found', 'eggcup-library-catalogue' ),
	);
	$rewrite = array(
		'slug'                       => 'publication-date',
		'with_front'                 => true,
		'hierarchical'               => true,
	);
	$args = array(
		'labels'                     => $labels,
		'hierarchical'               => true,
		'public'                     => true,
		'show_ui'                    => true,
		'show_admin_column'          => true,
		'show_in_nav_menus'          => false,
		'show_tagcloud'              => false,
		'query_var'                  => 'publication-date',
		'rewrite'                    => $rewrite,
	);
	register_taxonomy( 'publication-date', array( 'publication' ), $args );

}

// Hook into the 'init' action
add_action( 'init', 'publication_date', 0 );