Support » Plugins and Hacks » Visitor Maps and Who's Online » [Plugin: Visitor Maps and Who's Online] Hide Dashboard Widget for Non-Admins

  • mpjohnso

    (@mpjohnso)


    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

Viewing 15 replies - 1 through 15 (of 18 total)
  • Plugin Author Mike Challis

    (@mikechallis)


    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'));
    SVD85

    (@svd85)


    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.

    mpjohnso

    (@mpjohnso)


    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

    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!

    SVD85

    (@svd85)


    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.

    @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].

    mpjohnso

    (@mpjohnso)


    @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

    SVD85

    (@svd85)


    @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?

    @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!] 🙂

    mpjohnso

    (@mpjohnso)


    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.

    @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/

    Plugin Author Mike Challis

    (@mikechallis)


    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.

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

    mpjohnso

    (@mpjohnso)


    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

Viewing 15 replies - 1 through 15 (of 18 total)
  • The topic ‘[Plugin: Visitor Maps and Who's Online] Hide Dashboard Widget for Non-Admins’ is closed to new replies.