该插件尚未通过WordPress的最新3个主要版本进行测试。 当与较新版本的WordPress一起使用时,可能不再受到维护或支持,并且可能会存在兼容性问题。

Hide/Show Post/Page Content

描述

It permits to hide or show part of the content of posts or pages to users that are logged or not.
It’s also possibile to select the role(s) or the username(s) of logged users.

The content to be hidden or displayed must be included in a shortcode tagged as ‘soshsc‘.

The info page is available under the Tools menu.

It’s compatible with Elementor from the version 2.0.
The widget is in the general category.

Shortcode parameters

hide=”guest”
hides content to guests

hide=”logged”
hides content to legged users

show=”guest”
displays content to guests

show=”logged”
displays content to legged users

role=”subscriber”
enables the action (show/hide) only to users with the ‘Subscriber’ role

role=”subscriber,editor”
enables the action (show/hide) only to users with the ‘Subscriber’ or ‘Editor’ role

user=”foo”
enables the action (show/hide) only to the user with username ‘foo’

user=”foo,bar”
enables the action (show/hide) only to the users with username ‘foo’ or ‘bar’

Examples:

  1. Hide content to unlogged users:
    [soshsc hide=”guest”]This content is hidden only to users not logged.[/soshsc]

  2. Hide content to logged users:
    [soshsc hide=”logged”]This content is hidden only to logged users.[/soshsc]

  3. Show content only to unlogged users:
    [soshsc show=”guest”]This content is displayed only to users not logged.[/soshsc]

  4. Show content only to logged users:
    [soshsc show=”logged” role=”administrator”]This content is displayed only to administrators.[/soshsc]

屏幕截图

  • The info page (Tools Menu)
  • The Elementor widget (General Category)

评价

2023 年 2 月 22 日
I have been looking for a plugin with similar functionality for a long time. Very happy that I found it. That's what I need!
2020 年 9 月 14 日 1 回复
No instructions. Инструкцию надо добавлять
2020 年 7 月 27 日
Perfect when you don't need a complicated membership plugin, but in the same time, you want to display different content for logged-in users. Good job!
阅读所有5条评价

贡献者及开发者

“Hide/Show Post/Page Content” 是开源软件。 以下人员对此插件做出了贡献。

贡献者

「Hide/Show Post/Page Content」插件已被翻译至 1 种本地化语言。 感谢所有译者为本插件所做的贡献。

将“Hide/Show Post/Page Content”翻译成您的语言。

对开发感兴趣吗?

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

更新日志

1.5.3

  • Added a workaround to load the core file ‘pluggable.php’ before using the cache_users() function [WordPress 6.1 bug]

1.5.2

  • Updated the internal php library

1.5.1

  • Fixed a PHP notice in the info page
  • Updated the internal php library

1.5

  • Added the do_shortcode() function to allow nested shortcodes
  • Minor fixes and changes

1.4

  • Added shortcode parameters to select logged users by role or username
  • Minor changes

1.2

  • Configured the localization settings
  • Added the italian translation

1.1

Implemented the compatibility with Elementor 2.x

1.0

First release