Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- add_action( 'init', 'create_rights_stuff', 0 );
- // create two taxonomies, genres and writers for the post type "book"
- function create_rights_stuff() {
- $args = array(
- 'label' => 'Rights',
- 'public' => true,
- 'exclude_from_search' => false,
- 'publicly_queryable' => true,
- 'hierarchical' => false,
- 'supports' => array('title', 'editor'),
- 'has_archive' => 'rights'
- );
- register_post_type( 'right', $args );
- $labels = array(
- 'name' => _x( 'Rights', 'taxonomy general name' ),
- 'singular_name' => _x( 'Right', 'taxonomy singular name' ),
- );
- $args = array(
- 'hierarchical' => true,
- 'labels' => $labels,
- 'query_var' => true,
- 'rewrite' => array( 'slug' => 'rights/category' ),
- );
- register_taxonomy( 'rights-category', array( 'right' ), $args );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement