Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle changing pattern category names #532

Open
ryelle opened this issue Oct 26, 2022 · 4 comments
Open

Handle changing pattern category names #532

ryelle opened this issue Oct 26, 2022 · 4 comments
Labels
[Component] Pattern Directory The backend of the pattern directory: submission, management, etc

Comments

@ryelle
Copy link
Contributor

ryelle commented Oct 26, 2022

See WordPress/gutenberg#44501, WordPress/gutenberg#44203

The pattern categories are being rethought, so the names will be changing. The Pattern Directory provides patterns for multiple WP versions, but the categories themselves are hardcoded into each version. If the names update, sites who aren't using the latest Gutenberg would get a bunch of Uncategorized patterns.

This came up with the Banner category, where it was deemed OK, but if we're changing multiple categories that seems like a bad experience.

@ryelle
Copy link
Contributor Author

ryelle commented Oct 31, 2022

"Query" will be changed to "Posts" when GB 14.5 is released, so w.org/patterns will need a solution for then

ref WordPress/gutenberg#45244

@ntsekouras
Copy link

In my mind, we can create a mapper for previous category names with new ones and swap them while we show them in different parts of the UI. I haven't tested anything yet, but seems simple enough and similar to the blocks renaming handle we have, like the renamed embed or social blocks that got merged under one main block with variations.

@ryelle
Copy link
Contributor Author

ryelle commented Nov 15, 2022

That sounds like a good way for Gutenberg to handle older plugins/themes that register blocks with the old labels 👍🏻

For WP sites that aren't using Gutenberg (so just plain WP 6.1), if we update the categories for the Core & Featured patterns, they won't have those new categories. For example, a pattern that used to be "buttons" is now "call to action", but the non-GB site doesn't know "call to action". Is it OK that these will be "Uncategorized"? I suppose it's only 8 patterns that are "core" but not "featured", and the rest of the "featured" ones would stay in the Featured category.

Edit: Maybe this won't be necessary, waiting on some feedback from #190

@ntsekouras
Copy link

For WP sites that aren't using Gutenberg (so just plain WP 6.1), if we update the categories for the Core & Featured patterns, they won't have those new categories.

I'm not sure I get the problem.. Is it about the pattern creation UI in the directory? If yes, shouldn't a similar mapping in PD solve this as well? For example show in the UI, the new category, but during creation also add the old one. In WP sites now it will be shown only to the categories that are registered, depending on the usage of GB or not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Component] Pattern Directory The backend of the pattern directory: submission, management, etc
Projects
None yet
Development

No branches or pull requests

2 participants