Background image: add support for relative theme path URLs in template and pattern files #62254
Labels
[Feature] Themes
Questions or issues with incorporating or styling blocks in a theme.
[Type] Enhancement
A suggestion for improvement.
Part of:
What problem does this address?
Since #61271, themes can define relative paths to background images in theme.json files.
The same functionality does not yet exist for other theme assets, namely:
For these assets, theme authors should be able to add relative paths to background images, for example, in Group block attributes.
This impacts the portability of themes.
What is your proposed solution?
Parse block attributes and replace the relative URIs with absolute URIs using get_theme_file_uri.
Where this is done — on the frontend or clientside — is to be decided.
#61401 is a working example that runs clientside, but it will be worth investigating whether backend pre-processing is viable pursuant to #61271.
Related
The text was updated successfully, but these errors were encountered: