• emrl

    (@emrl)


    This topic is closed so I couldn’t add a reply: https://wordpress.org/support/topic/add-filter-to-capability-in-admin-menu-functions/

    But @bcworkz response does not work for submenu items because they are not added to the $submenu global if the user does not have the capability. So if a plugin registers a submenu with manage_options capability, and you hook into admin_menu to change it instead to edit_posts, it does not exist in the $submenu array at all. So unless a filter is added by the plugin author, there is no way to override the capability, without duplicating the plugins code and using add_submenu_page() yourself, but then you’d have to modify as the plugin updates.

Viewing 1 replies (of 1 total)
  • Thread Starter emrl

    (@emrl)

    @iconithemes thank you, but I’m suggesting that this filter be in core so that a theme developer can hook into any submenu, even if a plugin does not provide one.

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.