Skip to content

Instantly share code, notes, and snippets.

@alexphelps
Last active June 7, 2016 14:33
Show Gist options
  • Save alexphelps/7c99af62731ea6176288293f2420421e to your computer and use it in GitHub Desktop.
Save alexphelps/7c99af62731ea6176288293f2420421e to your computer and use it in GitHub Desktop.
Register Taxonomy
function register_teams_taxonomy() {
$labels = array(
'name' => __( 'Teams', 'taxonomy general name' ),
'singular_name' => __( 'Team', 'taxonomy singular name' ),
'search_items' => __( 'Search Teams' ),
'all_items' => __( 'All Teams' ),
'parent_item' => __( 'Parent Team' ),
'parent_item_colon' => __( 'Parent Team:' ),
'edit_item' => __( 'Edit Team' ),
'update_item' => __( 'Update Team' ),
'add_new_item' => __( 'Add New Team' ),
'new_item_name' => __( 'New Team Name' ),
'menu_name' => __( 'Teams' ),
);
$args = array(
'public' => true,
'hierarchical' => true,
'labels' => $labels,
'show_ui' => true,
'query_var' => true,
'rewrite' => array(
'slug' => 'teams',
'with_front' => true,
),
'show_admin_column' => true
);
register_taxonomy("product_team", array("product"), $args );
}
add_action( 'init', 'register_teams_taxonomy' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment