Private Content

描述

Private Content provides a shortcode to display a small 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, even a custom role.

Private Content is not intended to be used as a membership plugin management, but instead it should be used to show small parts of a post only to certain users or roles.

For a comprehensive explanation, please see the official Wiki on GitHub. The text of the Wiki is also available as a PDF, that you can download from here.

荣誉榜

I would like to say Thank You to all the people who helped me in making this plugin better and translated it into their respective languages.

Privacy Policy

This plugin does not collect any user data.

荣誉榜

Many thanks to:

屏幕截图

  • 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).

安装

This section describes how to install the plugin and get it working.

  1. Upload the private-content directory to the /wp-content/plugins/ directory
  2. Activate the plugin through the Plugins menu in WordPress
  3. Now the shortcode is available and ready to use.

常见问题

Is there a way to display an alternate text to readers that haven’t the rights to read the hidden text?

This plugin is not intended to be used in such way, but only in order to display a portion of a post to certain readers. Also, the hidden text must remain hidden, without the presence of an alternate text that could reveal the presence of the hidden text. Anyway, as of version 2.2, the plugin can display an alternate text, if it’s necessary: you can use the alt option to do that. You can find more information in the Wiki page.

Also, this plugin was created only to show a small piece of text (i.e. a couple of lines) as a note to the post for particular readers.

If you need to show the entire post only to certain readers (i.e. readers who pay to read a post), you can use a plugin like Members.

The hidden text is similar to the public text. Is it possible to stylize it in a different look?

Yes, you have to edit the CSS file of your current theme.
The shortcode generates a <p> HTML tag with some classes, for example:

  • private to stylize all private contents
  • [role]-content to stylize the content for that specific [role].
  • [role]-only to stylize the content for that specific [role] only.

See the official Wiki for more information.

Does this plugin work with custom roles?

Yes, custom roles are fully supported starting from version 6.0. You can find more information in the Wiki page.

评价

2021年11月9日
Also ich habe sehr lange gesucht um gewissen Content nur für gewisse User zugänglich zu machen. Dieses hier ist SO einfach, dass es schon wieder grenzgenial ist. Du kannst Content für Gruppen, einzelne User, User IDs, ... freigeben. und Dazu auch noch einzelne User, Usergruppen, ... ausnehmen. ECHT JETZT! Das is so genial und so einfach und unkompliziert gelöst (zumindest für den User der es installiert - keine Ahnung wie viel Mühe der Programmierer hatte :)) Also ... Leute, wer so ein Plugin sucht ist hier bestens bedient.
2021年9月11日
I installed the Private content plugin, but I can't find anything to suggest that the plugin exists. I don't know where and how to paste the code to make it work. Who could help?
2022年3月7日
Awesome both the plugin and the author! I needed two extra options and Aldo upgraded his plugin in a few hours. Thank you so much!
2020年6月4日
Gracias a los desarrolladores por este sencillo pero gran plugin, así como a la documentación actualizada para su funcionamiento.
阅读所有26条评价

贡献者及开发者

“Private Content” 是开源软件。 以下人员对此插件做出了贡献。

贡献者

“Private Content”插件已被翻译至4种本地话语言。 感谢所有译者为本插件所做的贡献。

将“Private Content”翻译成您的语言。

对开发感兴趣吗?

您可以浏览代码,查看SVN仓库,或通过RSS订阅开发日志

更新日志

6.5.0

  • Added post-author-custom case for role option (thanks to @agenziae20).

The full changelog is documented in the changelog file released along with the plugin package and is hosted also on GitHub.