Last active
June 7, 2016 14:33
-
-
Save alexphelps/7c99af62731ea6176288293f2420421e to your computer and use it in GitHub Desktop.
Register Taxonomy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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