이 플러그인은 최근 3개의 주요 워드프레스 출시와 시험 되지 않았습니다. 워드프레스의 좀 더 최근 버전으로 이용할 때 더 이상 관리되지 않고 지원되지 않고 호환성 문제가 있을 수 있습니다.

If Widget – Visibility control for Widgets

설명

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

  • Display a widget only if User is logged in
  • Hide widgets if Is mobile device OR Visitor is from US
  • Display widgets only for Admins and Editors
  • Hide Login or Register widgets for Logged in Users
  • Show widget only for Admins AND Is not mobile device

Visibility Rules

These are the visibility rules you can add for widgets:

  • User state: User is logged in
  • User role: User is Admin or Editor (plus all the available roles)
  • User registration: User registration is allowed
  • Post type: Current post type is Post or Product
  • Page type: Current page is Front Page or Blog Page
  • URL: Current URL starts/ends with "this-page"
  • URL: Current URL contains with "keyword"
  • Device detection: Is mobile device
  • Visitor location: Visitor is from US or Spain
  • Visitor language: Visitor language is English or Spanish
  • Third-party plugin integrations: Show if user is in Group "Group Name", Show if user has Subscription "Example Subscription" and more ✱

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

FAQ

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.

후기

2023년 5월 18일
This is the only plugin that actually let me target by URL. Other plugins apparently could, but none worked for me. This was the last plugin I was willing to try before giving up. The interface is also simple and intuitive. I hope to see this plugin become more popular!
2021년 11월 27일
Tried it. No options in the widget area. It appears this plug-in no longer works.
2020년 12월 21일
I tried other plugins and not fullfil my needs. But, If Widget – Visibility control for Widgets is the only exceptions. The main of my need is restrict widget for certain user role, then this plugin solved my problem.
2020년 6월 18일
Plugin works fine but would be nice if I could choose something like: If post id is…, or if category id is…., if tag is…. Or is it possible and I‘m searching too far? cheers Rangi
2020년 4월 25일
If you are trying the other widget control plugins, you are wasting your time. This one is perfect.
2020년 4월 7일
Was looking for a simple plugin to hide widgets based on user role or if they were signed in or not. This works flawlessly! Great work!
모든 9 평가 읽기

기여자 & 개발자

“If Widget – Visibility control for Widgets”(은)는 오픈 소스 소프트웨어입니다. 다음의 사람들이 이 플러그인에 기여하였습니다.

기여자

변경이력

0.5 – 7 March 2020

  • Added – Visibility rule – Is Archive page (checks for year/month/category archive page)
  • Updated – Ensure compatibility with WordPress 5.4
  • Fixed – Vsibility rules control in Customizer

0.4 – 24 October 2019

  • Updated – Text Visibility rule option: Text doesn’t contain
  • Updated – Ensure compatibility with WordPress 5.3

0.3 – 5 July 2019

  • Added – Visibility rule – Users can register
  • Added – Support for paid Addon, which adds more visibility rules

0.2 – 2 March 2019

  • Updated – Plugin texts
  • Updated – Compatibility with WordPress 5.1

0.1

  • Plugin release. Includes basic visibility rules