WordPress / WordPress/pattern-directory

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

Open
#698 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

[Component] Pattern Directory [Component] Theme
Dominant language
PHP
Stars
134
Forks
46
Avg merge
9h 4m
Merged PRs (30d)
19

Description

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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the linked Gutenberg issue 60323 and the related pattern-directory issue 494, then trace how patterns are copied from the Pattern Directory into the editor. Confirm which copied image attributes retain local IDs. Done means copied patterns no longer retain those IDs and the editor offers the upload image option for images absent from the destination site.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
content
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.