Frontend Bar
A persistent bar appears at the very top of every frontend page while a switch session is active.
Navigate to SwitchGuard → Settings → Frontend Bar.
Settings
| Setting | Default | Description |
|---|---|---|
| Enable Frontend Bar | Yes | Show the bar on the frontend while switched |
| Bar Color | #2E266D | Background colour (hex) |
| Bar Message | Viewing as {user} | Message text (supports {user} token) |
| Show Avatar | Yes | Display the target user's avatar next to the message |
Available Tokens in Bar Message
| Token | Output |
|---|---|
{user} | Target user's display name |
{email} | Target user's email address |
{role} | Target user's primary role label |
The bar is injected via wp_footer and positioned at the top of the viewport with position: fixed. It includes a Switch Back button that operates identically to the admin bar control.
💡
Choose a high-contrast bar color to make it immediately obvious when you are in a switched session, reducing the risk of accidentally making changes as the target user.