wp-dkblue-orange-1024x768

Private Content

Fork me on GitHub

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

  1. private-content screenshot 1

    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.

  2. private-content screenshot 2

    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

aldolat, specialk.

Other Notes

Credits

Many thanks to:

Support

You can get support in this forum.

Donations

Say your “Thanks!” to the developer with a small donation.





  • fresherscamp

    it does not fit with genesis framework. :-(

    • http://www.aldolat.it/ aldolat

      I’m sorry for this, but I haven’t this framework to test it.

      If you use Genesis, you can ask in the framework’s forum for help. Then, it will be appreciated if you share here the solution for other users.

  • Jacki

    Hello,

    How to do for displaying a portion of a post’s content only to users WITH NO specific role (visitors, non registred persons) with Private Content ? (would be very helpful)

    • http://www.aldolat.it/ aldolat

      Good point! I’ve just added this feature and pushed up the new 2.1 version to the WordPress repository. Wait for the update notification or manually update it.

      Now you can use:

      [private role="visitor-only"]Text for Visitors only[/private]

      Thanks for the tip!

    • http://www.aldolat.it/ aldolat

      More technical info in my new post on my English blog.

  • Pingback: Private content 2.1 « aldolat dev