Forums
Home / Plugins / how to add multiple menu pages within one plugin
(@roakin)
15 years, 6 months ago
i need to add a menu page with some submenu page to my wordpress which works fine. but when trying to add a second menu with different submenus i doesn’t work. my source is
add_menu_page(‘Admin’, ‘Admin’, 8, __FILE__, ‘myFunction’); add_submenu_page(__FILE__, __(‘Start’, ‘myFunction’), __(‘Start’, ‘myFunction’), 8, __FILE__, ‘myFunction’);
add_menu_page(‘Client’, ‘Client’, 0, __FILE__, ‘myClientFunction’); add_submenu_page(__FILE__, __(‘Start’, ‘myClientFunction’), __(‘Start’, ‘myClientFunction’), 0, __FILE__, ‘myClientFunction’);
so the first menu should only be visible to the admin and the second one also to registered users
thanks in advance
no ideas? as workaround i could create a second plugin but there are some functions i’d like to share to both menu areas
was my mistake … didn’t define the myClientFunction … sorry for any circumstances