Support » Plugin: User Switching » [Plugin: User Switching] Can't switch back with admin bar suppressed?

  • Resolved dhempy


    This looks like a great plugin. Thanks for sharing it!

    Unfortunately, I’ve got a scenario that prevents me from using it. We suppress the admin bar on our site, so there is no “Switch back” link.

    We use the plugin, “Remove BuddyPress Admin Bar” to suppress the admin bar. FWIW, we also use s2member, which I see mentioned in .

    For now, I’m using another plugin to get user switching (“Browse As”), as it does not depend on the admin bar. It appears User Switching is a more robust solution, so I would happily switch to it if there was a workaround. I recognize I’m probably in a pretty unusual situation, so this is not a feature request.

    Thanks again for contributing your work to the community, John!


Viewing 5 replies - 1 through 5 (of 5 total)
  • Oh yeah…we also restrict multiple logins from the same account. This coupled with the inability to Switch Back resulted in me being locked out of my admin account until it timed out on its own. That was the core of my problem.

    Again, this is probably a pretty unique scenario, I acknowledge.


    Would this be possible:

    While impersonating another user, if you click “Logout” you either a) revert back to yourself; or b) log your primary (admin) session out, so that you could then log in anew?

    Either of those would be a boon to me, and perhaps helpful to others. This could be in addition to the “Switch Back” button you already have.


    Plugin Author John Blackbourn


    WordPress Core Developer

    Hi dhempy,

    I appreciate that if you switch to a user which has the admin bar suppressed then there is no switch back link. I don’t want to go adding extra links in though, as I like the plugin to stay out of the way as much as possible.

    You may find this other thread helpful: . I’ve just posted some code with which you can add a switch back link to your theme yourself.


    Thanks, John. I’ll use that approach when I get some time.

    FWIW, I ended up copying your plugin and hacking it with this addition:

    add_action( 'get_header',	                	array( $this, 'admin_notice' ), 1 );
    		// Added by dhempy 9/14/2012 11:16:15 since we don't have an admin bar or footer.
    		// using get_header for this is a appears above <html>... probably will break some nuance of our styles.  I'll repent later.
    		// would be better to find a good action hook at the top of the page, but I failed at that.  *sigh* -dave

    I wanted to call add_action() from our own code so it wouldn’t break our update path with user-switching, but could not figure out how to add an action to a class function from outside the class.

    Thanks for the reply, and the great module.


    I abandoned the get_header approach, above, and created a shortcode instead. Details here:

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Plugin: User Switching] Can't switch back with admin bar suppressed?’ is closed to new replies.