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

November 29, 2023
Giving Tuesday breaks record for Foundation support

In a year in which households across the nation are struggling due to the rising costs of necessities, ATSS Foundation…

April 4, 2023
3M pledge wall raises more than $14K for ATSS Foundation

This year’s 3M pledge wall raised $14,820 for The ATSS Foundation. This was the seventh year 3M has operated the virtual wall fundraiser, which ran from the start of the year through the end of ATSSA’s Convention & Traffic Expo. 3M launched the event with an offer to match up to $5,000 in donations. When the tally fell just short of that figure—at $4,820—the company elected to provide the full match. Those funds plus 3M’s $5,000 sponsorship provided The Foundation with a total of $14,820. ATSS Foundation Vice Chair Peter Johnston stands in front of the 3M Pledge Wall on the Traffic Expo floor during ATSSA's 2023 Convention & Traffic Expo in Phoenix in February. This year’s 3M pledge wall raised $14,820 for The ATSS Foundation. This was the seventh year 3M has operated the virtual wall fundraiser, which ran from the start of the year through the end of ATSSA’s Convention & Traffic Expo. 3M launched the event with an offer to match up to $5,000 in donations. When the tally fell just short of that figure—at $4,820—the company elected to provide the full match. Those funds plus 3M’s $5,000 sponsorship provided The Foundation with a total of $14,820. “We are grateful for 3M’s support of The Foundation through this fundraiser for seven years running,” said Foundation Director Lori Diaz. “We appreciate the company’s commitment and its generosity in donating the full match amount.  Our generous donors make a difference in educating people about roadway safety and in the lives of people affected by roadway tragedies.” The ATSS Foundation is the charitable arm of ATSSA and exists to promote roadway safety through charitable giving and public awareness programs.

March 30, 2023
ATSS Foundation recognizes Shirley family for longtime support

The ATSS Foundation recently recognized the Shirley family of Georgia with the nonprofit’s Ambassador Award. The Foundation Ambassador Award recognizes an individual or entity for extraordinary efforts in supporting The Foundation’s core purpose of promoting roadway safety through charitable giving and public awareness programs. Georgia ATSSA Chapter President Rick Brockman nominated the family for the Foundation Ambassador Award in recognition of their years-long efforts in helping both The Foundation and the Georgia Department of Transportation, both of which offer college scholarships. ATSS Foundation Vice Chair Peter Johnston, left, presented the Foundation Ambassador Award to Ryan Shirley, center, on behalf of his family during The Foundation’s Annual Golf Classic Tournament on Feb. 17 in Phoenix. Georgia ATSSA Chapter President Rick Brockman nominated the Shirley family for the recognition. The ATSS Foundation recently recognized the Shirley family of Georgia with the nonprofit’s Ambassador Award. The Foundation Ambassador Award recognizes an individual or entity for extraordinary efforts in supporting The Foundation’s core purpose of promoting roadway safety through charitable giving and public awareness programs. The Shirley family, which owns and operates Safety Signal Co. in Georgia, has for 13 years run the Jim Shirley Memorial Golf Tournament and donated half of the proceeds to benefit The ATSS Foundation. The other half has gone to the Georgia Department of Transportation GDOT for scholarships. Safety Signal Co. was founded in Forest Park, Ga., in 1969 by Jim Shirley and Dave Bussey, who were brothers-in-law. The family has continued operating the business since then, with Jim’s widow—Dee Shirley—as the current owner. The company is now located in Union City, Ga. Georgia ATSSA Chapter President Rick Brockman nominated the family for the Foundation Ambassador Award in recognition of their years-long efforts in helping both The Foundation and GDOT, both of which offer college scholarships. “The Shirley family has started, managed, promoted and worked on the annual Jim Shirley Memorial Golf Tournament with this being the 13th  year,” Brockman wrote in nominating the family. “They literally shut down their company for the day to make this event successful.” The ATSS Foundation Board approved the award in November and presented it to Ryan Shirley at The Foundation’s Annual Golf Classic Tournament held as part of ATSSA’s 53rd Annual Convention & Traffic Expo in Phoenix in February. “We are extremely grateful to all of the members of the Shirley family for their many years of support,” said Foundation Director Lori Diaz. “Their commitment to The Foundation through this event that honors Jim Shirley has made a difference in the lives of young adults pursuing their dreams after a devastating loss and in helping raise awareness of the importance of roadway safety.” The ATSS Foundation Board reviews nominations for the Ambassador Award three times a year—in March, July and November. Details on the criteria and a nomination form are available online.  To date, four awards have been presented. The ATSS Foundation is the charitable arm of ATSSA.