WordPress.org

Forums

DMSGuestbook
[resolved] Hide Dashboard from non-Admins? (3 posts)

  1. JustinMorrison
    Member
    Posted 2 years ago #

    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.').

    Thanks,
    Justin

    http://wordpress.org/extend/plugins/dmsguestbook/

  2. DanielSchurter
    Member
    Plugin Author

    Posted 2 years ago #

    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)
    e.g:
    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.

    Greetings,
    Dani

  3. JustinMorrison
    Member
    Posted 2 years ago #

    Thanks Daniel!

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

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • DMSGuestbook
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.