My main goal at Tidy Repo is to protect you from all the problems that…
Often times when browsing your WordPress site, you’ll want to switch to different users so you can publish a post, or to test something quickly as a new user with different capabilities. User Switching lets you do that.
What’s It Do?
User Switching allows you to switch between any user in your WordPress install, and gives you an easy way to switch back when you are finished. Only users with the edit_users capability (Administrators or Super Admins by default) can switch, and SSL is integrated automatically where it is applicable.
The plugin also features a “Switch Off” button in your admin bar. So if you want to see your site as a logged out user quickly, you just click Switch Off, then hit the Switch On button when you are finished. It works in Multisite and Buddypress as well.
How’s It Work?
User Switching does not have any settings, when you activate the plugin it will just start working. If you are logged in as a user with the ability to edit other users, usually the Admin or Super Admin in a Multisite install, then go to Users -> All Users. If you hover over any users name you will see a new link entitled “Switch To.”
Clicking on this will switch you to another user. When you browse the admin dashboard, or your main site, you will be browsing as the switched to user, with their restrictions and capabilities. If you make any edits, these edits will be in the name of the user.
When you are in the dashboard as a switched user, you will see a yellow callout box at the top of the page with a link to “Switch back to…”. If you click on this you will be switched back as the main user seamlessly. There is also a Switch Back link in your admin bar, under the user information.
When you are logged in as an admin, there is also a new button on your admin bar labeled “Switch off.” This is basically the equivalent of switching to no user. At the bottom of each page you will see a link to “Switch back to…” just like you would if you were switched to another user. However, when you browse the site, you will see it like someone who is not logged in. So if you have caching off for logged in users, or certain features only enabled for those that aren’t logged in, you can easily see if it is functioning correctly without completely logging out. For me, this is an incredibly useful feature.
The only other thing to mention is that there is a hook called each time a user is switched, so you can also hook in and tack on more information or links when a user switches. The hooks are:
switch_to_userwhen an admin user switches to a new user
switch_back_userwhen somebody switches back
switch_off_userwhen an admin switches off
Costs, Caveats, Etc.
User Switching is completely free and updated very often with bug fixes, small updates, and new translations. If you are having a problem John, the plugin developer, is active on the support forums. You should be able to find a solution to your problem there.