Skip to content

Fix editor CSS handle collision with Image Slider Block; update contributors - #15

Open
RahatSheikhLeon wants to merge 2 commits into
latestfrom
dev
Open

Fix editor CSS handle collision with Image Slider Block; update contributors#15
RahatSheikhLeon wants to merge 2 commits into
latestfrom
dev

Conversation

@RahatSheikhLeon

Copy link
Copy Markdown
Contributor

Summary

Fixes the other half of a cross-plugin asset-handle collision that broke the Arrow Prev/Next Icon pickers in Image Slider Block. Companion PR: EssentialBlocks/slider-block#18.

Root cause

dist/modules.css is built from this plugin's own controls submodule pin, so it differs between the Essential Blocks single-block plugins. It was enqueued as essential-blocks-editor-css — a shared name.

WP_Dependencies::add() returns false for an already-registered handle, while wp_enqueue_style() still queues that handle against the first registration's src and deps. Since active_plugins is sort()ed on activation, button-group sorts before slider-block and always registered first — silently discarding Image Slider's stylesheet along with its essential-blocks-icon-picker-css and essential-blocks-fontawesome dependencies. Those dependencies are the only route by which the icon-picker styles reach the queue, so its arrow icon pickers rendered unstyled with no Font Awesome glyphs.

The bug is bidirectional: with the load order reversed, this plugin would have been the one to lose its stylesheet and receive Image Slider's modules.css instead.

Fix

Renamed this plugin's handle to buttongroup-block-editor-css. Genuinely shared vendor assets (essential-blocks-animation, and Image Slider's icon-picker and Font Awesome handles) keep their shared names on purpose, so only one copy loads however many EB single-block plugins are active.

An audit of every asset handle in both plugins found no other plugin-specific asset sharing a handle. essential-blocks-animation was verified byte-identical across both plugins (71,091 bytes), and essential-blocks-eb-animation was verified functionally equivalent — both act on plugin-agnostic eb___ classes — so both were deliberately left shared.

Verification

Checked against WordPress's own WP_Dependencies/_WP_Dependency classes, not mocks, across the full activation matrix:

Scenario Image Slider Button Group
before — both active, button-group first FAIL PASS
before — both active, slider first PASS FAIL
after — both active, button-group first PASS PASS
after — both active, slider first PASS PASS
after — button-group alone PASS
after — slider-block alone PASS

No duplicate registrations in any scenario, and dependency print order resolves correctly. includes/helpers.php lints clean. No other code in the install referenced the old handle as a dependency, in wp_style_is(), or in a dequeue.

Not verified: the picker UI in a live browser — the local WordPress instance was not running.

Also

Removed jamilbd07 and fencermonir from the Contributors field in readme.txt.

Note

dev is 4 commits behind latest, so this may need latest merged in before it can go green.

🤖 Generated with Claude Code

RahatSheikhLeon and others added 2 commits August 17, 2026 18:20
`dist/modules.css` is built from this plugin's own `controls` submodule
pin, so it differs between the Essential Blocks single-block plugins.
Enqueuing it as `essential-blocks-editor-css` meant the first plugin to
register that handle won it outright — WP_Dependencies::add() returns
false for an already-registered handle, while wp_enqueue_style() still
queues it against the first registration's src and deps.

`active_plugins` is sort()ed on activation, so this plugin loaded first
and silently discarded Image Slider's stylesheet along with its icon
picker and Font Awesome dependencies, breaking that plugin's arrow icon
pickers. With the order reversed this plugin would have been the one to
lose its stylesheet.

Renaming to `buttongroup-block-editor-css` fixes it in both directions.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Remove jamilbd07 and fencermonir from the Contributors field.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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