Add filter for submenu capability
-
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 withmanage_options
capability, and you hook intoadmin_menu
to change it instead toedit_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 usingadd_submenu_page()
yourself, but then you’d have to modify as the plugin updates.
- You must be logged in to reply to this topic.