More Visibility Rules

⭐️no reviews yet

Plugins | Site Design | Menus

More Visibility Rules

Premium Addon with more visibility rules and priority support for If Menu and If Widget plugins.

500+ downloads
300+ active installations
Tested up to WP 5.2.2

← More Visibility Rules

Frequently Asked Questions

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 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($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.

Support

  • Version: 0.2
  • Last updated: 07 Jul 2019
  • Tested up to WordPress 5.2.2
  • Requires PHP 5.4 or higher
  • FAQ
  • Get support

Still need help?

Visit our Support page to learn more or to get in touch with a member of our support team.