Linux 软件免费装
Banner图

If Widget - Visibility control for Widgets

开发者 andreiigna
更新时间 2021年1月18日 18:49
PHP版本: 5.6 及以上
WordPress版本: 5.6
版权: GPL-3.0-or-later
版权网址: 版权信息

标签

widget roles display hide rules show visibility if

下载

详情介绍:

With If Widget you can control on which pages widgets are shown. Show or hide widgets with custom visibility rules (no PHP or technical knowledge required). The plugin is easy to use, each widget will have a new option “Show widget only if” which will enable the selection of visibility rules (example in Screenshots). Visibility rules can be combined with AND/OR to create even more personalised visibility options. Examples Visibility Rules These are the visibility rules you can add for widgets: More Visibility Rules Add-on The paid Add-on provides more visibility rules and priority support. Visibility Rules: unlock all visibility rules like: visitor location, membership status, user groups and more. A few examples are marked with ✱ above. Support: get one-on-one email support for any questions you may have about installing and configuring our plugins. Get More Visibility Rules.

屏幕截图:

  • If Widget plugin demo
  • Enable and choose visibility rules for Widgets
  • Visibility rules
  • Mix multiple visibility rules

常见问题:

How can I enable custom visiblity for a widget?

On Widgets editing page, each widget will have a section for controlling visibility. Enable the option "Show widget only if" to reveal and configure visibility rules (Example in screenshots).

How can I add a custom visibility rule for menu items?

New rules can be added by code in any other plugin or theme. Example of adding a new custom rule for displaying/hiding a widget when current page is a custom-post-type. ` // theme's functions.php or plugin file add_filter('if_visibility_rules', 'my_new_visibility_rule'); function my_new_visibility_rule(array $rules) { $rules['single-my-custom-post-type'] = array( 'name' => __('Single my-CPT', 'i18n-domain'), // name of the condition 'callback' => function() { // callback - must return Boolean return is_singular('my-custom-post-type'); } ); return $rules; } `

Where can I find conditional functions?

WordPress provides a lot of functions which can be used to create custom rules for almost any combination that a theme/plugin developer can think of.

更新日志:

0.5 - 7 March 2020 0.4 - 24 October 2019 0.3 - 5 July 2019 0.2 - 2 March 2019 0.1