Merged
Conversation
… when setting up this project locally
…always mix this up with line 32
… handles conflicts that happen when the editor and view assets have the same handle. Removed the t2 extension dependency filter as that was preventing the load of assets in the eidtor iframe. Aim for the same versioning for both styles and scripts - avoid the filemtime if possible.
There was a problem hiding this comment.
Pull request overview
This PR aims to improve WordPress apiVersion: 3 compatibility for the block theme by updating block metadata and adjusting how theme assets are enqueued across frontend/editor contexts, plus a couple of setup/documentation tweaks.
Changes:
- Updated
src/block.jsonto include a blocknameand explicit editor/view style/script entries usingfile:./...paths. - Refactored theme asset enqueuing to use
enqueue_block_assets/enqueue_block_editor_assetsand a sharedload_theme_assets()helper. - Adjusted multisite URL update instructions and clarified an
.env.examplecomment.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| packages/themes/block-theme/src/block.json | Adds required block metadata and defines editor/view assets for apiVersion 3. |
| packages/themes/block-theme/includes/setup-theme.php | Changes hooks and consolidates asset loading logic for frontend/editor contexts. |
| INSTALLATION.md | Updates WP-CLI multisite URL replacement command. |
| .env.example | Minor comment clarification for multisite env var. |
| $dep = $assets['dependencies'] ?? []; | ||
| $ver = $assets['version'] ?? \filemtime( $dir . 'editor.js' ); | ||
| \wp_enqueue_script( $handle, $url . 'editor.js', $dep, $ver, true ); | ||
| \wp_set_script_translations( $handle, 'block-theme', \get_template_directory() . '/languages' ); |
Member
There was a problem hiding this comment.
Is this needed? I think having the text domain in the style.css is enough, correct @luistinygod ?
stian-overasen
approved these changes
Mar 25, 2026
Member
stian-overasen
left a comment
There was a problem hiding this comment.
Other than not needing editorStyle and style in block.json, this looks good. 👍
Co-authored-by: Stian <stian@dekode.no>
Co-authored-by: Stian <stian@dekode.no>
olethomas
approved these changes
Mar 25, 2026
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.
Short introduction
This PR aims to improve WordPress apiVersion: 3 compatibility for the block theme by updating block metadata and adjusting how theme assets are enqueued across frontend/editor contexts, plus a couple of setup/documentation tweaks.
Changes:
Updated src/block.json to include a block name and explicit editor/view style/script entries using file:./... paths.
Refactored theme asset enqueuing to use enqueue_block_assets / enqueue_block_editor_assets and a shared load_theme_assets() helper.
Adjusted multisite URL update instructions and clarified an .env.example comment.
Description