=== ZeeMee Polylang Block Visibility ===
Contributors: findinge
Donate link: https://zeemee.dk/en
Tags: polylang, gutenberg, blocks, visibility, multilingual
Requires at least: 6.5
Tested up to: 6.9
Requires PHP: 7.4
Stable tag: 1.0.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Adds Polylang-aware visibility controls to Gutenberg blocks so each block can be shown only for selected languages.

== Description ==

ZeeMee Polylang Block Visibility adds a simple language visibility field to Gutenberg blocks.

After activation, editors can open any block in the block editor and use the new **Language visibility** panel to control where the block should appear.

Examples:

* `da` to show the block only on Danish pages.
* `en` to show the block only on English pages.
* `da, en` to show the block on multiple languages.
* `en-gb` to match a locale-style language code.

The plugin is built to work with Polylang. When Polylang is active, it uses the current Polylang language context. If Polylang is not active, it gracefully falls back to the current WordPress locale.

== Installation ==

1. Upload the plugin files to the `/wp-content/plugins/zeemee-polylang-block-visibility` directory, or install the plugin through the WordPress plugins screen.
2. Activate the plugin through the **Plugins** screen in WordPress.
3. Edit any post, page, or template in the block editor.
4. Select a block and open the **Language visibility** panel in the inspector sidebar.
5. Enter one or more language codes separated by commas.

== Frequently Asked Questions ==

= Does this require Polylang? =

No. The plugin is designed for Polylang, but it will still work by using the current WordPress locale if Polylang is not active.

= Which blocks are supported? =

The visibility attribute is added to Gutenberg blocks that support attributes, including core blocks and most third-party blocks.

= Can I use more than one language code? =

Yes. Separate language codes with commas, for example `da, en`.

== Changelog ==

= 1.0.1 =
* Removed manual load_plugin_textdomain() call to comply with current WordPress Plugin Check guidance.
* Kept script translations via wp_set_script_translations().

= 1.0.0 =
* Initial release.
* Added Gutenberg block language visibility control.
* Added Polylang-aware frontend rendering filter with locale fallback.
