WordPress / pattern-directory

The WordPress Block Pattern Directory
https://wordpress.org/patterns/
GNU General Public License v2.0
125 stars 35 forks source link

Patterns: Remove `id`s from the copied pattern code #698

Open ryelle opened 4 months ago

ryelle commented 4 months ago

See https://github.com/WordPress/gutenberg/issues/60323 — Patterns created outside of the pattern creator have "local" images, with id values matching that other site. When they're used in the pattern directory and then copied, the ID attribute tells the editor that it's not an external image, so you don't get the "upload image" button, even though it's not an image on the destination site.

Can the id attribute be filtered out on copy so that this doesn't happen?

Related: https://github.com/WordPress/pattern-directory/issues/494