Advertisement
Guest User

Untitled

a guest
Sep 17th, 2013
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.84 KB | None | 0 0
  1. <?php
  2.  
  3. add_action( 'init', 'create_rights_stuff', 0 );
  4.  
  5.  
  6. // create two taxonomies, genres and writers for the post type "book"
  7. function create_rights_stuff() {
  8.    
  9.     $args = array(
  10.         'label' => 'Rights',
  11.         'public' => true,
  12.         'exclude_from_search' => false,
  13.         'publicly_queryable' => true,
  14.         'hierarchical' => false,
  15.         'supports' => array('title', 'editor'),
  16.         'has_archive' => 'rights'
  17.     );
  18.     register_post_type( 'right', $args );
  19.  
  20.     $labels = array(
  21.         'name'              => _x( 'Rights', 'taxonomy general name' ),
  22.         'singular_name'     => _x( 'Right', 'taxonomy singular name' ),
  23.     );
  24.     $args = array(
  25.         'hierarchical'      => true,
  26.         'labels'            => $labels,
  27.         'query_var'         => true,
  28.         'rewrite'           => array( 'slug' => 'rights/category' ),
  29.     );
  30.     register_taxonomy( 'rights-category', array( 'right' ), $args );
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement