WordPress.org

Ready to get started?Download WordPress

Forums

User Switching
[resolved] Can't switch back with admin bar suppressed? (6 posts)

  1. dhempy
    Member
    Posted 2 years ago #

    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 http://wordpress.org/support/topic/plugin-user-switching-no-switch-back-option?replies=2 .

    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!

    -dave

    http://wordpress.org/extend/plugins/user-switching/

  2. dhempy
    Member
    Posted 2 years ago #

    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.

    -dave

  3. dhempy
    Member
    Posted 2 years ago #

    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.

    -dave

  4. John Blackbourn
    Member
    Plugin Author

    Posted 1 year ago #

    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: http://wordpress.org/support/topic/plugin-user-switching-template-tag-show-switch-back-link . I've just posted some code with which you can add a switch back link to your theme yourself.

    John

  5. dhempy
    Member
    Posted 1 year ago #

    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 hack...it 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.

    -dave

  6. dhempy
    Member
    Posted 1 year ago #

    I abandoned the get_header approach, above, and created a shortcode instead. Details here: http://wordpress.org/support/topic/plugin-user-switching-template-tag-show-switch-back-link?replies=4

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic