One of the frequently asked questions the users of my plugin Private Content do is the following:
Is there a way to display an alternate text to readers that haven’t the rights to read the hidden text
I’ve always answered that this plugin was designed to show only a simple note to the subscribers/collaborators, leaving other members/visitors out of any type of message. But often a developer can’t imagine all the possible usages a piece of software can encounter. This plugin, clearly, is used not only to display private notes/messages to some people, but also to display an alternative text if these readers haven’t the rights to read that note/message.
I’ve been always opposed to add this feature, but today I added it to Private Content. So, if you asked for it, update the plugin to version 2.2.
Usage
As usual write the to-be-hidden sentence wrapped into the shortcode, but add option alt
, for example:
[private role="author" alt="Sorry, but you have not rights to read this."]Secret text for authors[/private]
In this way Authors (and higher members, like Editors and Amministrators) will read this, while lower members will read only Sorry, but you have not rights to read this.
Enjoy!