<?php


// hook into the init action and call create_semester_taxonomies when it fires
add_action( 'init', 'create_semester_taxonomies', 0 );


// create two taxonomies, terms and writers for the post type "semester"
function create_semester_taxonomies() {
  // Add new taxonomy, make it hierarchical (like categories)
  $labels = array(
    'name'              => _x( 'Terms', 'taxonomy general name' ),
    'singular_name'     => _x( 'Term', 'taxonomy singular name' ),
    'search_items'      => __( 'Search Terms' ),
    'all_items'         => __( 'All Terms' ),
    'parent_item'       => __( 'Parent Term' ),
    'parent_item_colon' => __( 'Parent Term:' ),
    'edit_item'         => __( 'Edit Term' ),
    'update_item'       => __( 'Update Term' ),
    'add_new_item'      => __( 'Add New Term' ),
    'new_item_name'     => __( 'New Term Name' ),
    'menu_name'         => __( 'Term' ),
  );

  $args = array(
    'hierarchical'      => true,
    'labels'            => $labels,
    'show_ui'           => true,
    'show_admin_column' => true,
    'query_var'         => true,
    'rewrite'           => array( 'slug' => 'terms' ),
  );

  register_taxonomy( 'terms', array( 'post' ), $args );

}