Membership view site as

How do I hide the View Site As different membership levels in the admin toolbar from subsite admins?

  • Timothy
    • Chief Pigeon

    Are they a membership admins?

    Or have they been?

    I do notice that in Membership:

    Admin –> Membership –> Options –> Membership Admins

    That you can check an admin and save, when it refreshes their checkbox is no longer checked.

    Saving again does not seem to remove them as a membership admin.

    Do you get the same?

    Let me know.

    Take care.

  • Timothy
    • Chief Pigeon

    Hey again.

    Basically I saw that if you select an admin and save then when it refreshes the page those Membership Admins are still not selected.

    Saving again does nothing.

    So I suspect that this is a bug and once they are made Membership Admins, they are still there regardless of whether it’s checked or not.

    I think it’s for this reason your other admins still see that drop down.

    I’ll let Barry know about this.

    Thanks.

  • Timothy
    • Chief Pigeon

    You’re running Pro Sites right?

    If you are, then please temporary disable, then go to:

    Admin –> Membership –> Options –> Membership Admins

    Are any of those admins now checked?

    If so then please uncheck them and then reenable Pro Sites.

    Let me know if that fixes it.

    Thanks.

  • Atlanta
    • Syntax Hero

    @tim, thanks.

    When I deactivate pro sites and go to Admin –> Membership –> Options –> Membership Admins

    There are no admins listed and therefore no admins checked or unchecked.

    When I reactivate pro sites and try to view as different levels only the navigation menu seems to change. Some of my widgets use logic like is blog user 1 so that won’t change, I understand, but protected content such as the marketpress store’s porducts show on the membership View site as toolbar. They work correctly when I login as the different levels.

    How do I disable the view site as toolbar from everybody but super admins. Thanks

  • Timothy
    • Chief Pigeon

    I see, what I thought you were asking is why some admins could see that menu when they’re not Membership admins.

    Which led me to see this bug I described above. I then thought that was what you were referring to.

    How do I disable the view site as toolbar from everybody but super admins. Thanks

    Only Membership Admins and Super Admins see this, this is so they can test their levels and set ups.

    I see now the issue I found isn’t what you are having, you just want to hide it from all admins, membership or not.

    So open:

    /membership/membershipincludes/classes/class.adminbar.php

    Then you could edit the function direct, line 137:

    add_admin_bar_view_site_as()

    Or you could add a conditional around the add_action, line 184:

    if($active == 'yes') {
    add_action( 'admin_bar_menu', array( &$this, 'add_admin_bar_view_site_as' ), 8 );
    } else {
    add_action( 'admin_bar_menu', array( &$this, 'add_admin_bar_enabled_item' ), 8 );
    }

    The conditional could be like:

    if(is_super_admin) { }

    Depending on where you would like to tackel it. I’d probably go for the add_action, then it means it doesn’t need to run through the add_action, function and another conditional.

    Take care.

  • aecnu
    • WP Unicorn

    Greetings Atlanta,

    It appears this particular topic is now resolved/closed, if you need any further assistance please let us know.

    If it wasn’t resolved, or you have any more questions related to this thread, please feel free to post them below including any new symptoms or errors and tick the ‘Mark as Not Resolved (re-open)’ box below the post area (or else we’ll miss it!)

    Cheers, Joe

  • PC
    • WPMU DEV Initiate

    Hiya,

    Greetings and thanks for being a great community member.

    We haven’t heard from you on this one for long and I am doing a regular followup to see if there is still something we can assist you on this thread.

    Just to manage the support issues more efficiently, I am marking this thread as resolved for now however this is not being done to avoid your questions in any ways.

    Please feel free to mark this is “Not resolved” in case you have further questions and we would be back on it.

    Thanks a lot for being with WPMU DEV.

    Cheers

    PC

    Sales &Support

    Did you know we offer FREE lifetime memberships? Click here to learn more.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.