| 开发者 |
fernandot
ayudawp |
|---|---|
| 更新时间 | 2026年8月15日 07:28 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
widget-visibility-control folder to /wp-content/plugins/Yes! Widget Visibility Control works with all widget editing interfaces:
Yes. On activation, the plugin automatically imports all your existing Jetpack Widget Visibility rules. No reconfiguration needed.
Yes, but to avoid conflicts, our visibility interface is automatically disabled while Jetpack Widget Visibility module is active. You can continue using Jetpack's interface, and when you disable the Jetpack module, our interface will take over automatically. Your visibility rules are stored in both formats, so the transition is seamless.
On deactivation, your rules are preserved for when you reactivate. On uninstall, only this plugin's data is removed. If you haven't cleaned the legacy data, Jetpack can still read your original rules.
Yes. You can add multiple conditions and choose whether ALL conditions must match (AND logic) or just ONE condition needs to match (OR logic).
No. The plugin is optimized for performance with intelligent caching. Assets only load on admin widget screens, and frontend checks are minimal and cached.
No. This plugin works completely standalone without any external connections or dependencies.
This plugin is designed for widget areas (sidebars, footers, etc.). Full Site Editing themes typically don't use traditional widget areas - instead, they manage all content through the Site Editor using template parts and blocks. If your FSE theme includes widget areas, the plugin will work in those areas. If you need conditional visibility for blocks in FSE templates, you would need a different solution designed for the Site Editor.
Time scheduling allows you to show or hide widgets during specific date and time ranges. This is ideal for:
When you select "Taxonomy" as a condition, a second dropdown appears where you pick the specific taxonomy (e.g., Product Category, Color, Size). Only then does the third dropdown show the terms for that taxonomy. This cascading approach makes it much faster to find the right term on WooCommerce sites or any site with many custom taxonomies. For hierarchical taxonomies, you can also check "Include children" to automatically match all child terms of the selected term.
Yes, both from Widget Logic 5.x and 6.x — they use the same storage format in the database. When the plugin detects Widget Logic data, you'll see a notice and a section in Appearance > Widget Visibility > Import / Export. The importer shows each widget that had Widget Logic code, the original PHP, and the rule we extracted. For widgets whose code we can't translate automatically, you decide per widget: import as always visible, import as always hidden, or skip.
Most of the common conditional tags: is_home, is_front_page, is_single, is_singular (with or without a post type), is_page (with an ID, a slug, or no arguments at all), is_category, is_tag, is_author, is_archive, is_search, is_404, is_date / is_day / is_month / is_year, is_user_logged_in, is_sticky, is_paged, is_attachment, is_privacy_policy, is_tree, current_user_can, is_tax, has_term, has_category, is_post_type_archive, in_category, and has_tag. WooCommerce shops are covered too: is_product, is_shop, is_cart, is_checkout, is_account_page, is_product_category, is_product_tag and is_woocommerce. Rules that are just a constant (true, false, or combinations like !(true || false)) import as always visible or always hidden. Lists of values are supported too, in both notations: is_page( array( 1, 2, 3 ) ) and is_page( [ 1, 2, 3 ] ). So are negated rules like !is_home(), !is_page(2) && !is_page(3), or !( is_home() || is_category(5) ), which are imported as "hide" rules. Combinations using only AND or only OR are supported. What still cannot be translated automatically: mixed AND/OR expressions, a negated condition combined with a positive one, wp_is_mobile, code reading $_SERVER or post meta, and custom functions. For those the importer tells you why and asks what to do with that widget.
No. The original Widget Logic data stays in the database so you can roll back if needed. From Appearance > Widget Visibility > Import / Export you can delete it later with "Remove Widget Logic data".
Yes, both. In Appearance > Widget Visibility > Import / Export, the Export section downloads a JSON file with every rule, which widget each one belongs to, the plugin version and the site it came from. The same section restores a file back, so it works as a real backup and as a way to carry a setup from a staging site to production.
When restoring you choose what happens to what is already there: Merge only touches the widgets present in the file and leaves the rest alone, while Replace clears every current rule first so the site ends up exactly as the file describes.
Rules are matched to widgets by their identifier (text-3, categories-2...), so a restore lands correctly on the same site or on a copy of it. On a different site the identifiers may belong to other widgets, so check the result. Anything the file contains that this version does not understand is skipped and reported, never imported half-way.
Not yet. Widget Options stores its visibility data in a format that's very different from Widget Logic and Jetpack, and an importer is a separate effort. If you only used Widget Options for visibility, you can configure the equivalent rules in our plugin manually — the most common scenarios (pages, post types, taxonomies, user roles, login state) are all supported.
ayudawp_wvc_capabilities filter.