Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

User Position

Taxonomy for users

// Register Custom Taxonomy
function user_staff_position() {

	$labels = array(
		'name'                       => _x( 'Positions', 'Taxonomy General Name', 'hkdc' ),
		'singular_name'              => _x( 'Position', 'Taxonomy Singular Name', 'hkdc' ),
		'menu_name'                  => __( 'Poistion', 'hkdc' ),
		'all_items'                  => __( 'All Positions', 'hkdc' ),
		'parent_item'                => __( 'Parent Position', 'hkdc' ),
		'parent_item_colon'          => __( 'Parent Position:', 'hkdc' ),
		'new_item_name'              => __( 'New Position Name', 'hkdc' ),
		'add_new_item'               => __( 'Add New Position', 'hkdc' ),
		'edit_item'                  => __( 'Edit Position', 'hkdc' ),
		'update_item'                => __( 'Update Position', 'hkdc' ),
		'separate_items_with_commas' => __( 'Separate positions with commas', 'hkdc' ),
		'search_items'               => __( 'Search Positions', 'hkdc' ),
		'add_or_remove_items'        => __( 'Add or remove positions', 'hkdc' ),
		'choose_from_most_used'      => __( 'Choose from the most used position', 'hkdc' ),
		'not_found'                  => __( 'Not Found', 'hkdc' ),
	);
	$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( 'user_position', 'post', $args );

}

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