Plugin Menu appears twice in Super Admin
Question
I am buliding a plugin and have different menu options based on different user-role in wp-admin.
I have user role as Administrator, Subscriber since lastweek we had migrated to Multisite Admin and we have new role of Super-admin.
Now the issue is plugin displays all my menu twice in Super admin access. Following in the code used to different users. I am looking at not displaying the plugin menu for Super Admin.
public function setSubpages()
{
$this->subpages = array(
// for Admin user
array(
'parent_slug' => 'my_plugin',
'page_title' => 'Call Log',
'menu_title' => 'Call log admin',
'capability' => 'manage_options',
'menu_slug' => 'plugin_call_log_admin',
'callback' => array( $this->callbacks, 'adminCalLog' )
),
// For other user / subscriber
array(
'parent_slug' => 'my_plugin',
'page_title' => 'Call Log',
'menu_title' => 'Call log telecaller',
'capability' => 'telle_caller',
'menu_slug' => 'plugin_telecaller',
'callback' => array( $this->callbacks, 'tellerCallerCalLog' )
)
);
}
0
admin-menu, plugin-development, plugins, sub-menu, wp-admin
3 years
2020-08-27T03:10:33-05:00
2020-08-27T03:10:33-05:00 0 Answers
54 views
0
Leave an answer