Skip to content

Fix allowed blocks#34

Merged
firestar300 merged 3 commits into
developfrom
fix/allowed-blocks
Jun 23, 2026
Merged

Fix allowed blocks#34
firestar300 merged 3 commits into
developfrom
fix/allowed-blocks

Conversation

@firestar300

@firestar300 firestar300 commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

Note

Medium Risk
Changes how editor allowlists are loaded and which blocks get trigger UI; behavior is mitigated by legacy settings and JS fallbacks but should be verified in the block editor on a current WordPress version.

Overview
Fixes modal inner and trigger allowed-block lists not reaching the block editor on recent WordPress versions, where custom keys on block_editor_settings_all are dropped by the settings allowlist.

PHP now exposes filtered lists through wp_localize_script as blockpartyModalEditorSettings (innerAllowedBlocks, triggerAllowedBlocks), with shared helpers get_modal_inner_allowed_blocks() and get_modal_trigger_allowed_blocks() reused by the legacy settings filter and front-end trigger rendering. Editor JS reads those values first via getInnerAllowedBlocks() / getTriggerAllowedBlocks() in utils.js, with fallbacks to block editor settings and built-in defaults.

Also ignores composer.lock, removes the tracked lockfile, and renames npm scripts to env:start / env:stop.

Reviewed by Cursor Bugbot for commit 9a8a9c7. Bugbot is set up for automated code reviews on this repo. Configure here.

Localizes the allowed block lists for modal triggers and inner blocks using
wp_localize_script. This addresses an issue where recent WordPress versions
were stripping custom settings passed via the block_editor_settings_all filter,
leading to unreliable availability of these lists in the JavaScript editor.
The `composer.lock` file is no longer tracked and has been added to `.gitignore`.
@firestar300 firestar300 merged commit a1979dc into develop Jun 23, 2026
3 checks passed
@firestar300 firestar300 deleted the fix/allowed-blocks branch June 23, 2026 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant