Created
July 13, 2013 16:38
-
-
Save alexkingorg/5991273 to your computer and use it in GitHub Desktop.
Code to register a projects and projects groups taxonomy.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function akv3_register_projects_tax() { | |
register_taxonomy( | |
'projects', | |
array('post'), | |
array( | |
'hierarchical' => true, | |
'labels' => array( | |
'name' => __('Projects', 'projects'), | |
'singular_name' => __('Project', 'projects'), | |
'search_items' => __('Search Projects', 'projects'), | |
'popular_items' => __('Popular Projects', 'projects'), | |
'all_items' => __('All Projects', 'projects'), | |
'parent_item' => __('Parent Project', 'projects'), | |
'parent_item_colon' => __('Parent Project:', 'projects'), | |
'edit_item' => __('Edit Project', 'projects'), | |
'update_item' => __('Update Project', 'projects'), | |
'add_new_item' => __('Add New Project', 'projects'), | |
'new_item_name' => __('New Project Name', 'projects'), | |
), | |
'sort' => true, | |
'args' => array('orderby' => 'term_order'), | |
'public' => false, | |
'show_ui' => true, | |
) | |
); | |
register_taxonomy( | |
'project-groups', | |
array('project'), | |
array( | |
'hierarchical' => true, | |
'labels' => array( | |
'name' => __('Project Groups', 'projects'), | |
'singular_name' => __('Project Group', 'projects'), | |
'search_items' => __('Search Project Groups', 'projects'), | |
'popular_items' => __('Popular Project Groups', 'projects'), | |
'all_items' => __('All Project Groups', 'projects'), | |
'parent_item' => __('Parent Project Group', 'projects'), | |
'parent_item_colon' => __('Parent Project Group:', 'projects'), | |
'edit_item' => __('Edit Project Group', 'projects'), | |
'update_item' => __('Update Project Group', 'projects'), | |
'add_new_item' => __('Add New Project Group', 'projects'), | |
'new_item_name' => __('New Project Group Name', 'projects'), | |
), | |
'sort' => true, | |
'args' => array('orderby' => 'term_order'), | |
'public' => false, | |
'show_ui' => true, | |
) | |
); | |
} | |
add_action('init', 'akv3_register_projects_tax', 999); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment