Advertisement
Guest User

PeteNC2

a guest
Feb 18th, 2013
632
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.20 KB | None | 0 0
  1. //  Create taxonomy for talk types
  2. function nc_custom_taxonomies() {
  3.     // Add new "talktype" taxonomy to "talk" post type
  4.     register_taxonomy('talktype', 'talk', array(
  5.         'hierarchical' => true,
  6.         // This array of options controls the labels displayed in the WordPress Admin UI
  7.         'labels' => array(
  8.             'name' => _x( 'Talk Types', 'taxonomy general name' ),
  9.             'singular_name' => _x( 'Talk Type', 'taxonomy singular name' ),
  10.             'search_items' =>  __( 'Search Talk Types' ),
  11.             'all_items' => __( 'All Talk Types' ),
  12.             'parent_item' => __( 'Parent Talk Type' ),
  13.             'parent_item_colon' => __( 'Parent Talk Type:' ),
  14.             'edit_item' => __( 'Edit Talk Type' ),
  15.             'update_item' => __( 'Update Talk Type' ),
  16.             'add_new_item' => __( 'Add New Talk Type' ),
  17.             'new_item_name' => __( 'New Talk Type Name' ),
  18.             'menu_name' => __( 'Talk Types' ),
  19.         ),
  20.         'query_var' => true,
  21.         // Control the slugs used for this taxonomy
  22.         'rewrite' => array(
  23.             'slug' => 'talktype',
  24.             'with_front' => false, // Don't display the category base before "/locations/"
  25.             'hierarchical' => true // This will allow URL's like "/locations/boston/cambridge/"
  26.         ),
  27.     ));
  28. }
  29. add_action( 'after_setup_theme', 'nc_custom_taxonomies', 0 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement