Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 19th, 2012  |  syntax: None  |  size: 1.60 KB  |  hits: 11  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. ################################################################################
  2. // AUTHOR CUSTOM TAXONOMY
  3. ################################################################################
  4.  
  5. add_action( 'init', 'register_taxonomy_authors' );
  6.  
  7. function register_taxonomy_authors() {
  8.  
  9.     $labels = array(
  10.         'name' => _x( 'Authors', 'authors' ),
  11.         'singular_name' => _x( 'Anthor', 'authors' ),
  12.         'search_items' => _x( 'Search Authors', 'authors' ),
  13.         'popular_items' => _x( 'Popular Authors', 'authors' ),
  14.         'all_items' => _x( 'All Authors', 'authors' ),
  15.         'parent_item' => _x( 'Parent Anthor', 'authors' ),
  16.         'parent_item_colon' => _x( 'Parent Anthor:', 'authors' ),
  17.         'edit_item' => _x( 'Edit Anthor', 'authors' ),
  18.         'update_item' => _x( 'Update Anthor', 'authors' ),
  19.         'add_new_item' => _x( 'Add New Anthor', 'authors' ),
  20.         'new_item_name' => _x( 'New Anthor', 'authors' ),
  21.         'separate_items_with_commas' => _x( 'Separate authors with commas', 'authors' ),
  22.         'add_or_remove_items' => _x( 'Add or remove Authors', 'authors' ),
  23.         'choose_from_most_used' => _x( 'Choose from most used authors', 'authors' ),
  24.         'menu_name' => _x( 'Authors', 'authors' ),
  25.     );
  26.  
  27.     $args = array(
  28.         'labels' => $labels,
  29.         'public' => true,
  30.         'show_in_nav_menus' => true,
  31.         'show_ui' => true,
  32.         'show_tagcloud' => true,
  33.         'hierarchical' => false,
  34.         'update_count_callback' => '_update_post_term_count',
  35.         'rewrite' => true,
  36.         'query_var' => true
  37.     );
  38.  
  39.     register_taxonomy( 'authors', array('product'), $args );
  40. }