humanmade / humanmade/extended-block-variations

Cannot enqueue existing stylesheet by handle

Open
#6 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
1
Forks
0
PR merge metrics
No merged PRs in 30d

Description

This is not the _key_ use-case for this plugin, so deferring this to a bug rather than trying to fix it in the existing PRs:

If you specify an existing handle (registered in `wp_enqueue_scripts`) as the stylesheet for a variation,

```json
"stylesheet": "existing-registered-handle"
```

this stylesheet will usually not take effect as expected. This happens because the render_block callback which tries to enqueue the sheet will fire before the registration occurs, and an enqueue on an unregistered handle does nothing. This order of operations needs to be debugged, or we need to remove the advertised functionality about binding a style variation to a registered handle.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.