Transform image markup into patterns by removing database-specific references and replacing them with theme-relative paths. Remove attachment IDs that reference uploaded media.
Use get_template_directory_uri()
to create absolute URLs pointing to theme assets, combined with esc_url()
for security. Add internationalized alt text using esc_attr__()
for proper translation and escaping.
Test patterns by reloading the site editor and inserting them to ensure functionality before finalizing. Remove temporary markup used for alignment (like Group blocks) that was only needed during creation.
This technique enables theme designers to include branded imagery, decorative elements, and static media as part of the theme design while maintaining the visual editing workflow of the site editor.