Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

PLU | ct_year

// Register Custom Taxonomy
function ct_year() {

	$labels = array(
		'name'                       => _x( 'Years', 'Taxonomy General Name', 'plueckthun' ),
		'singular_name'              => _x( 'Year', 'Taxonomy Singular Name', 'plueckthun' ),
		'menu_name'                  => __( 'Publication Year', 'plueckthun' ),
		'all_items'                  => __( 'All Publication Year', 'plueckthun' ),
		'parent_item'                => __( 'Parent Publication Year', 'plueckthun' ),
		'parent_item_colon'          => __( 'Parent Item:', 'plueckthun' ),
		'new_item_name'              => __( 'New Publication Year Name', 'plueckthun' ),
		'add_new_item'               => __( 'Add New Publication Year', 'plueckthun' ),
		'edit_item'                  => __( 'Edit Publication Year', 'plueckthun' ),
		'update_item'                => __( 'Update Publication Year', 'plueckthun' ),
		'view_item'                  => __( 'View Publication Year', 'plueckthun' ),
		'separate_items_with_commas' => __( 'Separate Publication Years with commas', 'plueckthun' ),
		'add_or_remove_items'        => __( 'Add or remove Publication Years', 'plueckthun' ),
		'choose_from_most_used'      => __( 'Choose from the most used', 'plueckthun' ),
		'popular_items'              => __( 'Popular Publication Years', 'plueckthun' ),
		'search_items'               => __( 'Search Publication Years', 'plueckthun' ),
		'not_found'                  => __( 'Not Found', 'plueckthun' ),
		'no_terms'                   => __( 'No Publication Years', 'plueckthun' ),
		'items_list'                 => __( 'Publication Years list', 'plueckthun' ),
		'items_list_navigation'      => __( 'Publication Years list navigation', 'plueckthun' ),
	);
	$args = array(
		'labels'                     => $labels,
		'hierarchical'               => false,
		'public'                     => true,
		'show_ui'                    => true,
		'show_admin_column'          => true,
		'show_in_nav_menus'          => true,
		'show_tagcloud'              => true,
	);
	register_taxonomy( 'ct_year', array( 'cpt_publication' ), $args );

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