When importing a Bricks template containing an Image or Logo element with an ACF/SCF dynamic image source, the dynamic data reference is lost if the source field contains an SVG image.
Instead of preserving the dynamic data reference, Bricks replaces the image settings with a placeholder SVG.
When the same dynamic image field contains a PNG or JPG image instead, the dynamic data reference is preserved during import.
Steps to reproduce
-
Create an ACF/SCF image field on an Options Page (e.g.
brand_logo). -
Assign an SVG image to this field.
-
Add an Image or Logo element to a Bricks template and set its dynamic image source to
{acf_brand_logo}. -
Export the template using Bricks’ native export functionality.
-
Import the template into another WordPress site with image importing disabled.
-
Check the element’s image settings.
Actual behavior
The dynamic data reference {acf_brand_logo} is removed and replaced with a placeholder SVG.
Expected behavior
The dynamic data reference {acf_brand_logo} should remain unchanged, regardless of the image format stored in the field.
Workaround
Changing the image stored in the source site’s SCF field from SVG to PNG resolves the issue. With the same dynamic data reference {acf_brand_logo}, the template imports correctly.
Possible cause
In includes/templates.php, Templates::is_image() identifies SVG images based on their URL, even when the image settings contain useDynamicData.
This appears to trigger the image import/replacement process, which replaces the entire image settings object instead of preserving the dynamic data reference.