• Resolved keeganx

    (@keeganx)


    I’m trying to build a avatar editing plugin, but I’ve hit a roadblock. I’ve been researching how to do this for at least a few hours and have found nothing. I want to add a new tab in the menu (the backend, after you log in) that shows the current avatar etc. The only problem is this:

    add_action(‘admin_menu’, ‘addmyplugintoasubmenu’);

    only works with admin users. I need the tab to show up for non-admin users as well (editors and authors). I tried installing the role modification plugin, but adding a capability does nothing than just take a string. I seriously can’t figure out why a plugin can only add tabs to admin users only. Basically I’m asking if there’s this:

    add_action(‘admin_menu’, ‘addmyplugintoasubmenu’);

    but for more than just admin users.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter keeganx

    (@keeganx)

    OH! EUREKA!!!!!!! Basically instead of adding a new tab I can just add stuff to the end of the profile section, which is better anyway! NICE!

    Though it stil would be cool to be able to add tabs tha all users could see…

    whooami

    (@whooami)

    umm, I use that hook in a plugin and I can tell you that my admin page is visible to all users.

    Its what comes after that is important.

    add_action('admin_menu', 'your_menu');

    function your_menu () {
    	add_users_page('Title', 'Your Title', 1, basename(__FILE__), 'some_function');
    }

    Here’s an example:

    add_menu_page(‘Web Invoice System’, ‘Web Invoice’, 6, __FILE__, ‘wp_invoice_options_page’);

    The 6 is what determines minimum user level to see the plugin in the menu. Then there may be additional current_user_can() conditional statements within the plugin.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘add_action admin_menu viewable by all users?’ is closed to new replies.