Display a portion of a post content only to users of a specific role or to a single user.
This plugin provides a shortcode to display a portion of a post content only to users of a specific role. For example, you can show the hidden text to Editors or to Authors or to any other WordPress role.
Please, note that an Administrator can read an Editor private content or a Subscriber private content, and so on. Same thing for Editor, Author, Contributor, and Subscriber: a higher role can read a lower role content.
Also you can show the hidden text only to a certain role. For example, you can mark a text as visible only to Contributors and hide it to higher roles, such as Administrators or Editors and so on.
As of version 3.0 you can mark a text as visible only to a certain user, using his login name.
As of version 4.0 you can mark a text as visible to multiple users, using their login names comma separated.
Display this text only to Administrators:
[private role="administrator"]Text for Administrators[/private]
Display this text only to Administrators and Editors:
[private role="editor"]Text for Editors[/private]
Display this text only to Administrators, Editors, and Authors:
[private role="author"]Text for Authors[/private]
Display this text only to Administrators, Editors, Authors, and Contributors:
[private role="contributor"]Text for Contributor[/private]
Display this text only to Administrators, Editors, Authors, Contributors, and Subscribers:
[private role="subscriber"]Text for Subscribers[/private]
If you want to show a note only to a certain role, you have to use a
In this way, for example, an Administrator or an Editor (roles higher than Author) cannot read a note only for Authors.
These are all the cases:
[private role="editor-only"]Text for Editors only[/private]
[private role="author-only"]Text for Authors only[/private]
[private role="contributor-only"]Text for Contributors only[/private]
[private role="subscriber-only"]Text for Subscribers only[/private]
[private role="visitor-only"]Text for Visitors only[/private]
In the case you want to show a text only to a specific user, assign
role and a login name to
[private role="none" recipient="login-name"]Text for a specific user only[/private]
login-name with the correct login name of the target user.
You can use a comma separated list of usernames to target certain users:
[private role="none" recipient="login-name1, login-name2, login-name3"]Text for specific users only[/private]
login-name3 with the correct login names of the target users.
If you want to show an alternate text in case the reader can't read, you can use:
[private role="author" alt="You have not rights to read this."]Text for authors only[/private]
Please, take note that the alternate text, if defined, is always publicly displayed.
The alternate text can contain some HTML tags. The list is:
strongfor bold text;
ifor italic text;
afor links, with
titledo not use double quote, but single quote.
Starting from version 2.4, the user can choose the container element for the text:
pis the default value;
divis another option. This element allows you use HTML elements like lists, headings, and more.
spanis the final option. This element allows you to add private content inline.
[private container="div"]This is the text[/private]
I met with a friend[private container="span"] (Jenny, from ninth grade)[/private] for lunch.
WordPress roles in descending order:
Requires: 3.0 or higher
Compatible up to: 4.7.1
Last Updated: 1 month ago
Active Installs: 8,000+
0 of 1 support threads in the last two months have been marked resolved.
Got something to say? Need help?