
內容簡介
ABCode View As Role Switcher 讓管理員能夠在不登出及不需為每個角色創建測試帳號的情況下,查看網站前端的內容,並模擬選定用戶角色的視圖,確保內容的正確性和可見性。
【主要功能】
• 從工具列切換角色,前端和 wp-admin 一鍵可達
• 以登出訪客身份查看,檢查來賓體驗
• 真實的能力切換,current_user_can() 及角色檢查一致
• 可見的切換狀態,工具列顯示當前角色
• 一鍵返回自己的帳號,避免鎖定自己
• 自動過期,會話可選擇 15 分鐘、1 小時或 8 小時結束
外掛標籤
開發者團隊
② 後台搜尋「ABCode View As Role Switcher」→ 直接安裝(推薦)
原文外掛簡介
ABCode View As Role Switcher lets an administrator see the front end of the site exactly as a chosen user role sees it, without logging out and without creating a test account for every role on the site.
Pick a role from the toolbar, and the front end reloads with that role’s capabilities. Member-only content hides itself. Price rules, menus, shortcodes and blocks that check who is looking behave as they would for a real customer or subscriber. Pick Switch back and you are yourself again.
Switch to a role, not to a user
Most switching plugins log you in as a specific person. That is a different job, and it means keeping a spare account for every role you want to check, then keeping those accounts in step as the site changes.
This plugin switches to the role. Add a role today, test it in the next click. There is no dummy account to create, no password to store, no extra user cluttering the users list, and nothing to tidy up afterwards. It never touches anybody’s real account.
Capabilities actually change
The switch is applied where WordPress decides what a visitor is allowed to see, so current_user_can() tells the truth for the length of the session. That is the function themes, WooCommerce, membership plugins and page builders all call, which is why the pages you test look like the pages your users get.
The view is always a subset of your own account. It can only ever take capabilities away, never add them, so it can never be used to reach something you could not already reach.
Features
Switch from the toolbar: every role on the site is one click away, on the front end and inside wp-admin
View as a logged-out visitor: check the guest experience without a private window or a second browser
Real capability switching: current_user_can(), user_can() and role checks all agree with the role you picked
A visible switched state: the toolbar item turns green and reads “Viewing as: Subscriber”, so you always know what you are looking at
One-click way back: the same toolbar item ends the session, and wp-admin is never switched, so you cannot lock yourself out
Automatic expiry: a session ends by itself after 15 minutes, 1 hour or 8 hours, whichever you choose
Nothing is saved to the database: no user’s stored roles or capabilities are ever written to
Choose what appears: tick the roles you actually test with, and leave the rest out of the menu
Secure by design: a signed, HttpOnly cookie tied to your login session, plus a compulsory nonce on every switch
Free forever: no premium tier, no feature locks, no upsells
Translation ready: fully internationalised, with five languages included
Who is this for?
WooCommerce shops checking what a customer, a shop manager or a guest sees on a product page
Membership and course sites confirming that gated content really is gated
Agencies and freelancers handing over a site and wanting proof the permissions are right
Anybody who has ever asked “does this menu item show up for subscribers?”
How it works
Go to View As in the toolbar
Choose a role, or View as a logged-out visitor
Browse the site the way that role would
Choose Switch back to your own account when you are done
The switch applies to front-end page loads only. wp-admin, the REST API and admin AJAX always run as your real account, on purpose: it means there is always a way back, whatever the role you switched to is allowed to do.
Privacy
The plugin stores one cookie, set only when you start a view session, and only for you. It holds the role being viewed, an expiry time and a signature, and is removed when the session ends, when you log out, or when it expires. Nothing is sent anywhere, no data is collected, and no third party is involved.
