Support » Plugin: DMSGuestbook » Hide Dashboard from non-Admins?

  • Resolved JustinMorrison


    Hi Daniel,

    One change to your excellent plugin that I’d love to see is that the Dashboard would be hidden from non-Administrators. For example, I’ve set it up so that an Editor can only access the ‘Entries’ page, but he can still see the dashboard and click links which lead to dead ends (‘You need Administrator rights to have access to this page.’).


Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author DanielSchurter


    Hi Justin

    This needs a lot of code changes, I will give you a hint what you can do, but I have no time to do that, sorry.

    – Open admin.php in your dmsguestbook plugin directory

    – Create a new add_submenu_page (on line 70, there are other submenu pages)
    add_submenu_page( 'dmsguestbook' , __('Dashboard', 'dmsguestbook'), __('Dashboard', 'dmsguestbook'), 5,'dashboard', 'dmsguestbook_dashboard');

    (number 5 means, it’s an editor role)

    – create a new function with the same name as you defined.
    function dmsguestbook_dashboard() { }

    – Search for /* dashboard */ and insert the dashboard content in the function body. A simple copy & paste won’t work, you have to set the right global variable and the database handler.


    Thanks Daniel!

    I’m pretty sure I can figure it out, thanks to your hints. It’s just a matter of finding the time! 😉

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Hide Dashboard from non-Admins?’ is closed to new replies.