WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] add_menu_page for multiple users

[Resolved] add_menu_page for multiple users

  • Due to the unique way in which WordPress works it appears to be impossible to use add_menu_page for multiple roles. By declaring the same add_menu_page for two roles means one over-rides the other, and it will show only for the last declared one.

    So, how can anyone use add_menu_page for two or more user role types. I want my plugin dashboard menu items to appear for both administrators and editors.

Viewing 1 replies (of 1 total)
  • I worked out a fix

    add_menu_page('Memberships', 'Memberships', 'administrator','CWF_Memberships*', 'myp_memberships');
        add_menu_page('Memberships', 'Memberships', 'editor','CWF_Memberships', 'myp_memberships');
        add_menu_page('Resources', 'Resources', 'editor' , 'CWF_Resources', 'myp_resources');

    And yes….. add a * to the slug is the fix.

    WordPress really is s***!

Viewing 1 replies (of 1 total)
  • The topic ‘[Resolved] add_menu_page for multiple users’ is closed to new replies.
Skip to toolbar