This plugin provides a shortcode to display a portion of a post's content only to users of a specific role.
Usage:
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]
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.
If you want to show a note only to a certain role, you have to use a <role>-only option.
In this way, for example, an Administrator or an Editor (roles higher than Author) can't read a note only for Authors.
Here 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]
WordPress roles in descending order:
Administrator
Editor
Author
Contributor
Subscriber
| Name of the plugin: | Private Content |
| Plugin version: | 2.1 |
| This plugin requires | WordPress 3.0 |
| Tested up to | WordPress 3.5.1 |
| Last updated: | 16 February 2013 (95 giorni fa) |
| Compatibility: | 100% with WordPress 3.5.1 |
| Tags: | |
| Rating: | 5 stars |
Latest changes
- NEW: added the possibility to show a note only to Visitors (thanks to Jacki for the tip).
Download
You can get a copy from the page in the official repository: Private Content. This plugin has been downloaded 1,651 times.
Author
Author’s name: Aldo Latino
Profile on wordpress.org: Aldo Latino
Screenshots
-
At the center of the screen, the shortcode is used in the WordPress editor. The text inside the shortcode will be displayed only to Authors and above roles.
-
The shortcode in action. On the left, the text revealed to Administrators only; on the right, the page as seen by lower roles (Editors, Authors, etc., or simply readers).
Changelog
2.1
- NEW: added the possibility to show a note only to Visitors (thanks to Jacki for the tip).
2.0
- NEW: now you can show a note only to user of a specific role, hiding that note to higher roles.
- Added uninstall.php to delete the new custom capabilities.
1.2
- Now the inline style appears only if necessary.
1.1
- Upon request, added the possibility to align the text left, right, centered and justified.
1.0
- First release of the plugin.
Contributors
Other Notes
Credits
Many thanks to:
Jean Baptiste Jung for the idea behind this plugin;
Jeff Starr for the initial code.
Support
You can get support in this forum.
Donations
Say your “Thanks!” to the developer with a small donation.
Pingback: Private content 2.1 « aldolat dev