Demo Protected Content with Inline Shortcodes
Purpose
The [protect-content] shortcode can be used to show or hide small sections of content based on role or status.
Usage
It has three parameters:
- operation
- Whether to show or hide the content if the conditions are met. Valid values:
show
orhide
(default:show
) - role
- Which role(s) to require or forbid. Valid values: the internal name of any role (e.g.
administrator
,non-member
, etc.), comma-separated if more than one (default: null) - status
- Which status to require or forbid. Valid values:
logged-in
orlogged-out
(defaults to null)
Examples
Each code example is followed by the actual shortcode, but you’ll only see it if you meet the conditions.
Show content if conditions are met
[protect-content role="editor"]This content is only shown to Administrators and Editors.[/protect-content]
Result
[protect-content role="author"]This content is only shown to Administrators and Authors.[/protect-content]
Result
[protect-content role="contributor"]This content is only shown to Administrators and Contributors.[/protect-content]
Result
[protect-content role="member"]This content is only shown to Administrators and Members.[/protect-content]
Result
[protect-content role="subscriber"]This content is only shown to Administrators and Subscribers.[/protect-content]
Result
[protect-content status="logged-in"]This content is only shown to logged-in users.[/protect-content]
Result
Hide content if conditions are met
[protect-content operation="hide" role="editor"]This content is hidden from Editors.[/protect-content]
Result
This content is hidden from Editors.[protect-content operation="hide" role="author"]This content is hidden from Authors.[/protect-content]
Result
This content is hidden from Authors.[protect-content operation="hide" role="contributor"]This content is hidden from Contributors.[/protect-content]
Result
This content is hidden from Contributors.[protect-content operation="hide" role="members"]This content is hidden from Members.[/protect-content]
Result
This content is hidden from Members.[protect-content operation="hide" role="subscriber"]This content is hidden from Subscribers.[/protect-content]
Result
This content is hidden from Subscribers.[protect-content status="logged-out"]This content is only shown to visitors who aren't logged in.[/protect-content]
Result
This content is only shown to visitors who aren’t logged in.Recent Posts
December 12, 2024
Why One Client Fired Their Accountant—and What It Means for You
November 26, 2024
2025 Investment Outlook
Ready to get started?
Connect with a Glassman Wealth advisor today to continue the conversation.
Our Team
Meet Our Award-Winning Team
Our team of fiduciary advisors creates plans as unique as you are.
Services
Full Financial Advisory Services
Holistic Financial Planning, Investment Management, and more!
About Us
We're Different on Purpose
Our refreshing "Just One Client" mindset gives us the time to serve you.