Skip to content

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

@henriqueiamarino

Description

@henriqueiamarino

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions