Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Documan Custom Taxonomy

Custom Taxonomy for Documan Plugin

// Register Custom Taxonomy
function documan_register_custom_taxonomy() {

	$labels = array(
		'name'                       => _x( 'Resource Categories', 'Taxonomy General Name', 'documan' ),
		'singular_name'              => _x( 'Resource Category', 'Taxonomy Singular Name', 'documan' ),
		'menu_name'                  => __( 'Categories', 'documan' ),
		'all_items'                  => __( 'All Resource Categories', 'documan' ),
		'parent_item'                => __( 'Parent Category', 'documan' ),
		'parent_item_colon'          => __( 'Parent Category:', 'documan' ),
		'new_item_name'              => __( 'New Resources Category', 'documan' ),
		'add_new_item'               => __( 'Add New Resource Category', 'documan' ),
		'edit_item'                  => __( 'Edit Resource Category', 'documan' ),
		'update_item'                => __( 'Update Resource Category', 'documan' ),
		'view_item'                  => __( 'View Resource Category', 'documan' ),
		'separate_items_with_commas' => __( 'Separate resource categories with commas', 'documan' ),
		'add_or_remove_items'        => __( 'Add or remove Resource categories', 'documan' ),
		'choose_from_most_used'      => __( 'Choose from the most used', 'documan' ),
		'popular_items'              => __( 'Popular Resource Categories', 'documan' ),
		'search_items'               => __( 'Search Resource Categories', 'documan' ),
		'not_found'                  => __( 'Not Found', 'documan' ),
	);
	$rewrite = array(
		'slug'                       => 'resource-category',
		'with_front'                 => true,
		'hierarchical'               => false,
	);
	$args = array(
		'labels'                     => $labels,
		'hierarchical'               => true,
		'public'                     => true,
		'show_ui'                    => true,
		'show_admin_column'          => true,
		'show_in_nav_menus'          => true,
		'show_tagcloud'              => true,
		'rewrite'                    => $rewrite,
	);
	register_taxonomy( 'documan_category', array( 'documan_resources' ), $args );

}

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