• Resolved roakin

    (@roakin)


    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

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter roakin

    (@roakin)

    no ideas? as workaround i could create a second plugin but there are some functions i’d like to share to both menu areas

    Thread Starter roakin

    (@roakin)

    was my mistake … didn’t define the myClientFunction … sorry for any circumstances

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘how to add multiple menu pages within one plugin’ is closed to new replies.