One taxonomy for pages, users, and media
-
Hi, I would like to have one taxonomy for pages, users and media. I have the following code in my functions.php file:
function add_section_taxonomy(){ //set the name of the taxonomy $taxonomy = 'section'; //set the post types for the taxonomy $object_type = array('user','page','attachment'); //populate our array of names for our taxonomy $labels = array( 'name' => 'Sections', 'singular_name' => 'Section', 'search_items' => 'Search Sections', 'all_items' => 'All Sections', 'parent_item' => 'Parent Section', 'parent_item_colon' => 'Parent Section:', 'update_item' => 'Update Section', 'edit_item' => 'Edit Section', 'add_new_item' => 'Add New Section', 'new_item_name' => 'New Section Name', 'menu_name' => 'Sections' ); //define arguments to be used $args = array( 'labels' => $labels, 'hierarchical' => true, 'show_ui' => true, 'how_in_nav_menus' => true, 'public' => false, 'show_admin_column' => true, 'query_var' => true, 'rewrite' => array('slug' => 'sections') ); //call the register_taxonomy function register_taxonomy($taxonomy, $object_type, $args); } add_action('init','add_section_taxonomy');
The taxonomy shows up in pages, and I have applied it to some pages, but it doesn’t show up in the menu for users or media, nor on the pages for editing users or media. Is this possible? How can it be done?
Thanks
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘One taxonomy for pages, users, and media’ is closed to new replies.