• I have been following the information on adding administration menus and it’s working as intended except for the user permissions.

    add_menu_page(page_title, menu_title, capability, handle, [function], [icon_url]);

    This code works, but if I put ‘administrator’ in the capability spot then only the admin accounts can see it. If I put ‘subscriber’ then only subscribers see it and not the admins (or anyone in between).

    How can I make it so that this menu can be seen by all users?

Viewing 1 replies (of 1 total)
  • I just had this same problem and found one solution. If you put in the user level number, it seems to interpret as “allow all users with this user level and above to access this menu.” So, for instance, I wanted authors and above to access a menu and I put in:
    add_submenu_page('users.php', 'My Plugin Options', 'My Plugin', 2, 'really-cool', 'my_plugin_options');
    That seemed to work. I imagine that if you put user level as 0, it should allow everyone to access it. One word of caution is that the documentation does specifically state:

    Whilst for legacy reasons, you may also use user level the usage of user level is discouraged for future compatibility and has been deprecated since WordPress 1.5.

    So this might not be the best solution.

Viewing 1 replies (of 1 total)

The topic ‘Adding Administration Menus For All Users’ is closed to new replies.