Fix allowed blocks#34
Merged
Merged
Conversation
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`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_allare dropped by the settings allowlist.PHP now exposes filtered lists through
wp_localize_scriptasblockpartyModalEditorSettings(innerAllowedBlocks,triggerAllowedBlocks), with shared helpersget_modal_inner_allowed_blocks()andget_modal_trigger_allowed_blocks()reused by the legacy settings filter and front-end trigger rendering. Editor JS reads those values first viagetInnerAllowedBlocks()/getTriggerAllowedBlocks()inutils.js, with fallbacks to block editor settings and built-in defaults.Also ignores
composer.lock, removes the tracked lockfile, and renames npm scripts toenv:start/env:stop.Reviewed by Cursor Bugbot for commit 9a8a9c7. Bugbot is set up for automated code reviews on this repo. Configure here.