WordPress.org

Ready to get started?Download WordPress

Forums

Visitor Maps and Who's Online
Hide Dashboard Widget for Non-Admins (19 posts)

  1. mpjohnso
    Member
    Posted 3 years ago #

    I can't seem to find a way to hide the dashboard widget for non-admins, specifically authors, contributors, and subscribers. To clarify, I would like to hide the entire widget, not just the map inside it.

    Thanks in advance!

    Matt

  2. Mike Challis
    Member
    Plugin Author

    Posted 3 years ago #

    Currently it adheres to the current user manage_options role.

    http://codex.wordpress.org/Roles_and_Capabilities#manage_options

    if ( function_exists('current_user_can') && !current_user_can('manage_options') )
             die(__('You do not have permissions for managing this option', 'visitor-maps'));
  3. SVD85
    Member
    Posted 3 years ago #

    Try "WP Hide Dashboard" plugin. That's what I use. It hides the whole dashboard from users. They are only allowed to access their profile page.

  4. mpjohnso
    Member
    Posted 3 years ago #

    Thanks Mike for the tip. I'm not quite sure though what I need to change for this to be of use. Can you give a little more texture to where I might look?

    SVD85: I had some trouble with that plugin breaking some things for me, but I'll give it another shot

  5. Vince LaMonica
    Member
    Posted 3 years ago #

    Since I currently let my Editor users view the Visitor Maps dashboard widget, is there any way to let them also access the "Who's Online" and "Who's Been Online" admin pages too? Or at least a map on the dashboard widget? Right now, this is what an editor sees:

    https://skitch.com/vjl323/rg64n/editor-dashboard

    and these are my settings:

    https://skitch.com/vjl323/rg64r/maps-options

    Thanks!

  6. SVD85
    Member
    Posted 3 years ago #

    mpjohnso: Never heard of that plugin breaking. I know there is one that has a similar name. Are you using this one?:

    http://wordpress.org/extend/plugins/wp-hide-dashboard/installation/

    vjl323: What about making the map display on a page?
    Taken from the plugin's installation page:

    To display visitor maps on your blog: add the shortcode [visitor-maps] in a Page(not a Post). That page will become your Visitor Maps page. Here is how: Log into your blog admin dashboard. Click Pages, click Add New, add a title to your page, enter the shortcode [visitor-maps] in the page, click Publish.

  7. Vince LaMonica
    Member
    Posted 3 years ago #

    @SVD85 - Yeah, I tried that, and it works, but I'd rather not make it public - I only want the Editor of the site to be able to see the map [and Who's Online/Who's Been Online sections].

  8. mpjohnso
    Member
    Posted 3 years ago #

    @SVD85: Just tried it again and remembered that I don't use that because it takes out everything but the profile and for just subscribers. So I'm still at the point where I need to just hide the visitor maps for non-admins

  9. SVD85
    Member
    Posted 3 years ago #

    @vjl323: Sorry I missed that detail (half asleep writing this). I'm not aware of a way to view it on the dashboard - How about making the page private?

  10. Vince LaMonica
    Member
    Posted 3 years ago #

    @SVD85 - Good idea! Thanks! Doh! :-)

    @mpjohnso - I had a similar problem and I solved it on another blog with a great plugin called Adminimize. It lets you remove the widget from the dashboard for Editors, Authors, etc. :) I've locked up one blog very well, as everyone is an author [local private blog for a community]. Combined with Absolute Privacy 2.0b1, the site is pretty well locked up. Adminimize is available in wordpress.org's Plugin section and hasn't broken anything for me [yet!] :)

  11. Vince LaMonica
    Member
    Posted 3 years ago #

    @mpjohnso - here's a screenshot showing how I have it locked up:

    https://skitch.com/vjl323/rg65i/adminimize-options
    and
    https://skitch.com/vjl323/rg65s/adminimize-options

  12. mpjohnso
    Member
    Posted 3 years ago #

    I'm currently using adminimize actually. Great plugin however, I still want users to have access to the dashboard because I put a custom message/video in there as a tutorial for using the backend of the site. So i need to keep the dashboard but kill the one widget that visitor maps is putting in there (and not giving me an easy/intuitive way to get rid of it.

  13. Vince LaMonica
    Member
    Posted 3 years ago #

    @mpjohnso - an ugly hack would be to comment out [with a #] the beginning of line 1376 in visitor-maps.php:

    function visitor_maps_dashboard_widget() {
        global $visitor_maps_stats, $visitor_maps_opt;
    
    #    echo "<p>$visitor_maps_stats</p>";
        if ($visitor_maps_opt['enable_credit_link']) {

    The # before the echo will get rid of the body of the dashboard widget. To get rid of the title too, comment out line 1371 - the one that starts with
    # wp_add_dashboard_widget( ....

    Note this will block the dashboard widget for all users, not just editors.

    The file visitor-maps.php is in wp-content/plugins/visitor-maps

    HTH!

    /vjl/

  14. Mike Challis
    Member
    Plugin Author

    Posted 3 years ago #

    mpjohnso

    OK, a new version coming out today.

    = 1.5.6 =
    - (29 Dec 2010) - Added new setting: "Users who can view the dashboard pages:" By default, only Administrators can view the dashboard pages. Change this setting to also allow Editors, Authors, or Contributors to view the dashboard pages. When set to Authors, you are also allowing Administrator and Editors.
    - Fixed deprecated register_sidebar_widget function. After updating you need to add the "Who's Online" widget again. Click on Appearance, Widgets, then drag the Who's Online widget to the sidebar column on the right.

  15. Vince LaMonica
    Member
    Posted 3 years ago #

    @ Mike - wow! That was quick! Thanks so much!

  16. mpjohnso
    Member
    Posted 3 years ago #

    Mike,

    Got the new version installed, thanks for the amazingly fast response! I'm not sure why but my contributors and authors are still seeing the Visitor Maps widget on their Dashboard page. I have the setting you implemented set to admins. What am I doing wrong???

    Matt

  17. Mike Challis
    Member
    Plugin Author

    Posted 3 years ago #

    The changes I made hide the dashboard page and links to the page. I
    forgot to hide the widget. I will make another change for that.

  18. mpjohnso
    Member
    Posted 3 years ago #

    Great! Looking forward to it!

  19. Mike Challis
    Member
    Plugin Author

    Posted 3 years ago #

    visitor-maps.php is updated in the download with the fix.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic