WordPress / WordPress/create-block-theme

Bug: CBT does not localize images used as “repeated background” in Cover block

Open
#794 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
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.

Image

Steps to reproduce
  1. Insert a Cover block.
  2. Choose an image from the media library.
  3. In the Cover block settings, enable “Repeat background” (image set as repeated background).
  4. Use Appearance → Create Block Theme to generate a new theme.
  5. In the Create Block Theme UI, make sure “Localize images” is checked.
  6. Export, install, and activate the generated theme.
  7. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.