Skip to content

Instantly share code, notes, and snippets.

@mannieschumpert
Created July 14, 2012 04:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mannieschumpert/3109226 to your computer and use it in GitHub Desktop.
Save mannieschumpert/3109226 to your computer and use it in GitHub Desktop.
WordPress: Custom Taxonomy
<?php
// Create *_ taxonomy
add_action( 'init', 'create_TAXONOMYNAME' );
function create_TAXONOMYNAME() {
$labels = array(
'name' => _x( 'PLURAL', 'taxonomy general name' ),
'singular_name' => _x( 'SINGULAR', 'taxonomy singular name' ),
'search_items' => __( 'Search PLURAL' ),
'all_items' => __( 'All PLURAL' ),
'parent_item' => __( 'Parent SINGULAR' ),
'parent_item_colon' => __( 'Parent SINGULAR:' ),
'edit_item' => __( 'Edit SINGULAR' ),
'update_item' => __( 'Update SINGULAR' ),
'add_new_item' => __( 'Add New SINGULAR' ),
'new_item_name' => __( 'New SINGULAR Name' ),
);
register_taxonomy('PLURAL','POST-TYPE',array(
'hierarchical' => true, // false for tags
'labels' => $labels
));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment