Make WordPress Core

Opened 3 years ago

Last modified 18 months ago

#50252 new defect (bug)

Capability issue with admin menu

Reported by: mort1305's profile mort1305 Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 5.4.1
Component: Role/Capability Keywords:
Focuses: ui, administration Cc:

Description

An answering of a question on Stack Exchange (https://wordpress.stackexchange.com/questions/367518/how-do-i-code-access-to-the-built-in-ui-of-a-cpt-when-its-placed-as-submenu-of) led to the reporting of this bug. Please refer to it for further explanation and coding examples.

When a custom post type is registered, the show_in_menu option allows for the UI link of the custom post type to be nested under the menu of a second custom post type. However, if the user is authorized to view/edit the first post type, the UI of said nested post type is unavailable if the user does not also possess the capabilities required of the post type represented in the parent menu.

The bug is this: the admin menu is properly displaying the links to pages which the user is capable of viewing, but the user is not permitted to access those pages. The same can be said of any page whose link is nested in the admin menu under a page which the user does not possess the required capabilities of that parent.

Change History (1)

#1 @sabernhardt
18 months ago

  • Component changed from Administration to Role/Capability
  • Focuses administration added
Note: See TracTickets for help on using tickets.