A new version of my Private Content plugin has just been released! The new 2.1 version lets you show a note only to visitors and hide it to other users. So the shortcode now accepts this role:
[private role="visitor-only"]Text for Visitors only[/private]
As you probably know, there isn’t a role for Visitors. So, to accomplish this, the plugin makes a check if the user is logged in: if not, the note will be displayed and hidden to other logged-in users (Subscribers, Authors, and so on). Here the new code:
case 'visitor-only' : if ( ! is_user_logged_in() ) $text = '<p class="private visitor-content visitor-only"' . $align_style . '>' . $content . '</p>'; break;
As usual, the
p element has an its own class, so you can stylize it as you like via CSS.
This new feature has been added thanks to Jacki, a reader of my Italian blog, who left a comment with this new idea.