mannieschumpert
7/14/2012 - 4:38 AM

WordPress: Custom Taxonomy

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
  ));
}