WordPress / WordPress/create-block-theme
Bug: CBT does not localize images used as “repeated background” in Cover block
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 417
- Forks
- 66
- PR merge metrics
- No merged PRs in 30d
Description
Description
When using Create Block Theme with the “Localize images” option enabled, images used as a repeated background in a Cover block are not being localized into the generated theme.
Instead of being copied into the theme’s assets folder and referenced with a theme-relative URL, the Cover block keeps the original upload URL from the media library, for example:
"url": "http://localhost.local/wp-content/uploads/2025/12/sankofa-texture-one.png"
This breaks the expectation that all media will be bundled with the theme and no longer depend on the original site’s uploads directory.
Steps to reproduce
- Insert a Cover block.
- Choose an image from the media library.
- In the Cover block settings, enable “Repeat background” (image set as repeated background).
- Use Appearance → Create Block Theme to generate a new theme.
- In the Create Block Theme UI, make sure “Localize images” is checked.
- Export, install, and activate the generated theme.
- Inspect the Cover block in the exported theme (e.g., in the pattern/template file or in the Editor).
Environment
WordPress version: 6.9
Create Block Theme version: 2.7.0
PHP version: 5.7
Theme type: Child theme created via Create Block Theme
Site URL: local development (http://localhost.local)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in the Create Block Theme export flow with “Localize images” enabled, then inspect how a Cover block’s repeated background is represented in the generated pattern or template. Done means the image is copied into the generated theme’s assets folder and referenced with a theme-relative URL rather than the original uploads URL.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100