Skip to content

Instantly share code, notes, and snippets.

@BronsonQuick
Created June 1, 2012 03:51
Show Gist options
  • Save BronsonQuick/2848583 to your computer and use it in GitHub Desktop.
Save BronsonQuick/2848583 to your computer and use it in GitHub Desktop.
Register WordPress Taxonomy
<?php $labels = array(
'name' => _x( 'Types', 'taxonomy general name' ),
'singular_name' => _x( 'Type', 'taxonomy singular name' ),
'search_items' => __( 'Search Types' ),
'all_items' => __( 'All Types' ),
'parent_item' => __( 'Parent Type' ),
'parent_item_colon' => __( 'Parent Type:' ),
'edit_item' => __( 'Edit Type' ),
'update_item' => __( 'Update Type' ),
'add_new_item' => __( 'Add New Type' ),
'new_item_name' => __( 'New Type Name' ),
'menu_name' => __( 'Type' ),
);
register_taxonomy( 'section', array( 'discover_item' ), array(
'hierarchical' => true,
'labels' => $labels,
'show_ui' => true,
'query_var' => true,
'rewrite' => array( 'slug' => 'section' ),
));?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment