Unit Type Taxonomy – Sarabia’s
// Register Custom Taxonomy
function unit_type_taxonomy() {
$labels = array(
'name' => _x( 'Unit Types', 'Taxonomy General Name', 'sherpa' ),
'singular_name' => _x( 'Unit Type', 'Taxonomy Singular Name', 'sherpa' ),
'menu_name' => __( 'Unit Type', 'sherpa' ),
'all_items' => __( 'All Unit Types', 'sherpa' ),
'parent_item' => __( 'Parent Unit Type', 'sherpa' ),
'parent_item_colon' => __( 'Parent Unit Type:', 'sherpa' ),
'new_item_name' => __( 'New Unit Type', 'sherpa' ),
'add_new_item' => __( 'Add New Unit Type', 'sherpa' ),
'edit_item' => __( 'Edit Unit Type', 'sherpa' ),
'update_item' => __( 'Update Unit Type', 'sherpa' ),
'separate_items_with_commas' => __( 'Separate Unit Types with commas', 'sherpa' ),
'search_items' => __( 'Search Unit Types', 'sherpa' ),
'add_or_remove_items' => __( 'Add or remove Unit Types', 'sherpa' ),
'choose_from_most_used' => __( 'Choose from the most used Unit Types', 'sherpa' ),
'not_found' => __( 'Not Found', 'sherpa' ),
);
$args = array(
'labels' => $labels,
'hierarchical' => true,
'public' => true,
'show_ui' => true,
'show_admin_column' => true,
'show_in_nav_menus' => true,
'show_tagcloud' => true,
);
register_taxonomy( 'unit_type', array( 'unit' ), $args );
}
// Hook into the 'init' action
add_action( 'init', 'unit_type_taxonomy', 0 );