[wp-trac] [WordPress Trac] #36411: Missing admin menu for custom taxonomy

WordPress Trac noreply at wordpress.org
Mon Apr 4 21:41:18 UTC 2016


#36411: Missing admin menu for custom taxonomy
--------------------------+------------------------------
 Reporter:  jadpm         |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Menus         |     Version:  trunk
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------

Comment (by DrewAPicture):

 Wow, cool bug! Thanks for the report @jadpm.

 Based on the way the administration menus are built, it's kind of easy to
 see how this might happen. Essentially, all possible menus and submenus
 are added to the array from the get go in wp-admin/menu.php, then in wp-
 admin/includes/menu.php, items are removed based on capability.

 This was a fun one to track down. Essentially what's happening is that in
 [https://core.trac.wordpress.org/browser/trunk/src/wp-
 admin/includes/menu.php#L152 wp-admin/includes/menu.php], when you have an
 inaccessible post type and only a single taxonomy, the taxonomy gets re-
 parented and then the top-level and submenu both link to the same thing,
 so the submenu is removed, and later the parent is also removed.

 With two taxonomies, there's two submenus, so the first gets reparented
 with the post type label and both stay.

 So we essentially need to make a decision about expected behavior here. If
 you can't view/edit post type items, should you be able to view the
 taxonomy UIs for that post type? It's basically deciding between whether
 to whole-sale show the menu with both taxonomies as submenus, or always
 hide it if the post type parent is outside your access.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/36411#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list