Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Publication Physical Location

// Register Custom Taxonomy
function physical_location() {

	$labels = array(
		'name'                       => _x( 'Physical Locations', 'Taxonomy General Name', 'eggcup-library-catalogue' ),
		'singular_name'              => _x( 'Physical Location', 'Taxonomy Singular Name', 'eggcup-library-catalogue' ),
		'menu_name'                  => __( 'Physical Location', 'eggcup-library-catalogue' ),
		'all_items'                  => __( 'All Locations', 'eggcup-library-catalogue' ),
		'parent_item'                => __( 'Parent Location', 'eggcup-library-catalogue' ),
		'parent_item_colon'          => __( 'Parent Location:', 'eggcup-library-catalogue' ),
		'new_item_name'              => __( 'New Location Name', 'eggcup-library-catalogue' ),
		'add_new_item'               => __( 'Add New Location', 'eggcup-library-catalogue' ),
		'edit_item'                  => __( 'Edit Location', 'eggcup-library-catalogue' ),
		'update_item'                => __( 'Update Location', 'eggcup-library-catalogue' ),
		'separate_items_with_commas' => __( 'Separate Locations with commas', 'eggcup-library-catalogue' ),
		'search_items'               => __( 'Search Locations', 'eggcup-library-catalogue' ),
		'add_or_remove_items'        => __( 'Add or remove Locations', 'eggcup-library-catalogue' ),
		'choose_from_most_used'      => __( 'Choose from the most used Locations', 'eggcup-library-catalogue' ),
		'not_found'                  => __( 'Not Found', 'eggcup-library-catalogue' ),
	);
	$rewrite = array(
		'slug'                       => 'physical-location',
		'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'                  => 'physical-location',
		'rewrite'                    => $rewrite,
	);
	register_taxonomy( 'physical-location', array( 'publication' ), $args );

}

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