Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* create a custom taxonomy 'Custom Tags' for events in The Event Calendar Pro - I created a custom plugin for this code, but can be in functions.php */
- function create_custom_tags_taxonomy() {
- // Add new taxonomy, make it hierarchical like categories
- //first do the translations part for GUI
- $labels = array(
- 'name' => _x( 'Custom Tags', 'taxonomy general name' ),
- 'singular_name' => _x( 'Custom Tag', 'taxonomy singular name' ),
- 'search_items' => __( 'Search Custom Tags' ),
- 'all_items' => __( 'All Custom Tags' ),
- 'parent_item' => __( 'Parent Custom Tag' ),
- 'parent_item_colon' => __( 'Parent Custom Tag:' ),
- 'edit_item' => __( 'Edit Custom Tag' ),
- 'update_item' => __( 'Update Custom Tag' ),
- 'add_new_item' => __( 'Add New Custom Tag' ),
- 'new_item_name' => __( 'New Custom Tag Name' ),
- 'menu_name' => __( 'Custom Tags' ),
- );
- // Register the taxonomy and associate it with 'tribe_events' post type
- register_taxonomy('custom_tags',array('tribe_events'), array(
- 'hierarchical' => true,
- 'labels' => $labels,
- 'show_ui' => true,
- 'show_admin_column' => true,
- 'query_var' => true,
- 'rewrite' => array( 'slug' => 'custom-tags' ),
- 'sort' => true,
- ));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement