Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

MBM Taxonomy: Labels

Taxonomy of Labels, used for the custom post type of Notes.

if ( ! function_exists( 'notes_taxonomy' ) ) {

// Register Custom Taxonomy
function notes_taxonomy() {

	$labels = array(
		'name'                       => 'Note Labels',
		'singular_name'              => 'Note Label',
		'menu_name'                  => 'Note Labels',
		'all_items'                  => 'All Labels',
		'parent_item'                => 'Parent Label',
		'parent_item_colon'          => 'Parent Label:',
		'new_item_name'              => 'New Label Name',
		'add_new_item'               => 'Add New Label',
		'edit_item'                  => 'Edit Label',
		'update_item'                => 'Update Label',
		'view_item'                  => 'View Label',
		'separate_items_with_commas' => 'Separate labels with commas',
		'add_or_remove_items'        => 'Add or remove labels',
		'choose_from_most_used'      => 'Choose from the most used',
		'popular_items'              => 'Popular Labels',
		'search_items'               => 'Search labels',
		'not_found'                  => 'Not Found',
	);
	$rewrite = array(
		'slug'                       => 'labels',
		'with_front'                 => true,
		'hierarchical'               => true,
	);
	$capabilities = array(
		'manage_terms'               => 'manage_categories',
		'edit_terms'                 => 'manage_categories',
		'delete_terms'               => 'manage_categories',
		'assign_terms'               => 'manage_categories',
	);
	$args = array(
		'labels'                     => $labels,
		'hierarchical'               => true,
		'public'                     => true,
		'show_ui'                    => true,
		'show_admin_column'          => true,
		'show_in_nav_menus'          => false,
		'show_tagcloud'              => false,
		'rewrite'                    => $rewrite,
		'capabilities'               => $capabilities,
	);
	register_taxonomy( 'mbm_notes_tax', array( 'mbm_notes' ), $args );

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

}