Show Custom Taxonomy Default UI
-
Hello all!
I’ve been developing on WordPress for awhile, and greatly appreciate this CMS!
I’ve taken a look around to try and solve my problem, but haven’t found anything.Here’s my situation:
I’ve got three Custom Post Types.
I’ve got two Custom Taxonomies.I registered my Taxonomies first using:
register_taxonomy();
Then I registered my Custom Post Types and used the parameter ‘taxonomies’ to add the two Taxonomies to the Custom Post Types.
So far so good, the Custom Post Types show up in the back end, with the Custom Taxonomies listed under all the Custom Post Types. I can access the Custom Taxonomies management page where I can edit/delete the terms.
This is where things go bad.
I’ve got a Custom page declared using this line:
add_menu_page( 'Products', 'Products', 'publish_pages', 'products_top_level_menu_item', 'create_home_main_page', "", 26 );
Then using the ‘show_in_menu’ parameter when I register the Custom Post Types I add them to this Custom Page so they all appear under this page’s menu item. The idea is to keep the three different Product types together under a single Menu Item ‘Products’.
This works fine, they all show up properly, but I can’t access the Custom Taxonomies management pages. So if I (or more specifically the client) add’s a Term to a Product, but they spell it wrong, they can’t go and delete/edit the Term.
Is there a way to have the three Custom Post Types grouped under one Menu Item, but still have access to the Custom Taxonomies management page?
Thank you for your help!
Here is some of the code:
Register Page:
add_menu_page( 'Products', 'Products', 'publish_pages', 'products_top_level_menu_item', 'create_home_main_page', "", 26 );
Register Taxonomy:
$labels = array( 'name' => 'Health Need', 'singular_name' => 'Health Need', 'menu_name' => 'Health Need', 'all_items' => 'All Health Need', 'edit_item' => 'Edit Health Need', 'view_item' => 'View Health Need', 'update_item' => 'Update Health Need', 'add_new_item' => 'Add New Health Need', 'new_item_name' => 'New Health Need', 'parent_item' => 'Parent', 'parent_item_colon' => 'Parent', 'search_items' => 'Search Health Needs', 'popular_items' => 'Popular Health Needs', 'separate_items_with_commas' => '', 'add_or_remove_items' => 'Add or Remove Health Needs', 'choose_from_most_used' => 'Most Used Health Needs', 'not_found' => 'No Health Needs' ); $args = array( 'hierarchical' => true, 'labels' => $labels, 'show_ui' => true, 'show_admin_column' => true, 'query_var' => true, 'rewrite' => array( 'slug' => 'health_issue', 'with_front' => false, 'hierarchical' => true ) ); register_taxonomy('health_issue', '', $args);
Register Custom Post Type (where I add the taxonomies and add it to the page)
$labels = array( 'name' => 'Tincture', 'singular_name' => 'Tincture', 'add_new' => 'Add New', 'add_new_item' => 'Add New Tincture', 'edit_item' => 'Edit Tincture', 'new_item' => 'New Tincture', 'all_items' => 'Tinctures', 'view_item' => 'View Tincture', 'search_items' => 'Search Tinctures', 'not_found' => 'No Tinctures found', 'not_found_in_trash' => 'No Tinctures found in Trash', 'parent_item_colon' => '', 'menu_name' => 'Tincture' ); $args = array( 'labels' => $labels, 'public' => true, 'exclude_from_search' => false, 'publicly_queryable' => true, 'show_ui' => true, 'show_in_nav_menus' => true, //so if I leave this in, the Post Type shows up under the Products Menu //Item (good) but without the Taxonomies (bad) // 'show_in_menu' => 'products_top_level_menu_item', 'show_in_admin_bar' => false, 'menu_position' => 27, 'menu_icon' => null, 'capability_type' => 'post', 'map_meta_cap' => true, 'hierarchical' => false, 'supports' => array( 'title', 'thumbnail', 'editor', 'excerpt' ), 'query_var' => true, 'rewrite' => array( 'slug' => 'tincture' ), 'has_archive' => false, 'taxonomies' => array('health_issue', 'ingredient') ); register_post_type( 'tincture', $args );
[Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]
- The topic ‘Show Custom Taxonomy Default UI’ is closed to new replies.