I use a plugin that adds a submenu item to the admin menu, for example:
add_submenu_page( 'propertyhive', 'Property Hive Settings', 'Settings', 'manage_options', 'ph-settings', 'callback_fn' );
Because of this, by specifying manage_options
, it appears only for administrators. I need to show it to editors. Here is what I tried in my topic: functions.php file:
add_action( 'admin_menu', 'custom_settings_menu', 99 ); function custom_settings_menu() { // Remove the submenu item first remove_submenu_page( 'propertyhive', 'ph-settings' ); // Add it again but with different role (manage_propertyhive) // This role does exist as other submenu items ue it add_submenu_page( 'propertyhive', 'Property Hive Settings', 'Settings', 'manage_propertyhive', 'ph-settings', 'my_theme_callback_fn' ); }
Although this one does correctly displays the submenu item, I get the following error:
Sorry, you are not allowed to access this page.
Can anyone see something obvious or have any inclinations as to what might cause this?
Note. . The manage_propertyhive function definitely exists
source share