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 or hide (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 or logged-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.

Lorem Ipsum

Lorem Ipsum

Related News Articles

January 6, 2022
Applications due by Feb. 15 for Roadway Worker Memorial Scholarships

A work zone tragedy shouldn’t mean the end of the dreams and aspirations for the worker’s children or spouse. Roadway Worker Memorial Scholarships, offered by The American Traffic Safety Services ATSS Foundation, can help put the worker’s dependents on the road to a brilliant future. Applications for the 2022-23 academic year are due by Feb. 15. The Roadway Worker Memorial Scholarship Program provides financial assistance for post-high school education to the children or spouse of a roadway worker killed or permanently disabled in a work zone incident. Applicants who demonstrate a strong commitment to volunteerism may be eligible to receive an additional $1,000 in honor of Chuck Bailey, an esteemed member of the roadway safety industry from Ohio who died in 2002 as a result of an accident. A work zone tragedy shouldn’t mean the end of the dreams and aspirations for the worker’s children or spouse. Roadway Worker Memorial Scholarships, offered by The American Traffic Safety Services ATSS Foundation, can help put the worker’s dependents on the road to a brilliant future. Applications for the 2022-23 academic year are due by Feb. 15. The Roadway Worker Memorial Scholarship Program provides financial assistance for post-high school education to the children or spouse of a roadway worker killed or permanently disabled in a work zone incident. The competitive program provides scholarships valued up to $10,000 per student each year. Applicants who demonstrate a strong commitment to volunteerism may be eligible to receive an additional $1,000 in honor of Chuck Bailey, an esteemed member of the roadway safety industry from Ohio who died in 2002 as a result of an accident. The Roadway Worker Memorial Scholarship Program celebrates its 20th anniversary this year and has awarded $358,000 since its inception. Thirteen students are currently attending college thanks to a Roadway Worker Memorial Scholarship. Two of those also received a Chuck Bailey Memorial Scholarship for this school year. Hear from Roadway Worker Memorial Scholarship recipients about how The ATSS Foundation scholarships helped them achieve their dreams. “It is a privilege to help the dependents of fallen or permanently injured roadway workers pursue their goals,” said Foundation Director Lori Diaz. “But we couldn’t offer these scholarships without the generosity of individual donors, ATSSA members and sponsors of the events we hold throughout the year. Everyone’s contribution is essential to helping these worthy students pursue their dreams.” The ATSS Foundation is the charitable arm of ATSSA. It was formed in 1988 with the core purpose to promote roadway safety through charitable giving and public awareness programs. Donations can be made at Foundation.ATSSA.com/Donate.