Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //hook into the init action and call create_book_taxonomies when it fires
- add_action( 'init', 'create_destinations_taxonomy', 0 );
- //create "destinations" taxonomy for the post type "post"
- function create_destinations_taxonomy()
- {
- // Add new taxonomy, make it hierarchical (like categories)
- $labels = array(
- 'name' => _x( 'Destinations', 'taxonomy general name' ),
- 'singular_name' => _x( 'Destination', 'taxonomy singular name' ),
- 'search_items' => __( 'Search Destinations' ),
- 'all_items' => __( 'All Destinations' ),
- 'parent_item' => __( 'Parent Destination' ),
- 'parent_item_colon' => __( 'Parent Destination:' ),
- 'edit_item' => __( 'Edit Destination' ),
- 'update_item' => __( 'Update Destination' ),
- 'add_new_item' => __( 'Add New Destination' ),
- 'new_item_name' => __( 'New Destination Name' ),
- 'menu_name' => __( 'Destinations' ),
- );
- register_taxonomy('destinations',array('post'), array(
- 'hierarchical' => true,
- 'labels' => $labels,
- 'show_ui' => true,
- 'query_var' => true,
- 'rewrite' => array( 'slug' => 'destinations' ),
- ));
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement