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

Patterns: core 'featured' category not registered #40443

Closed
Andrew-Starr opened this issue Apr 19, 2022 · 5 comments · Fixed by #40650
Closed

Patterns: core 'featured' category not registered #40443

Andrew-Starr opened this issue Apr 19, 2022 · 5 comments · Fixed by #40650
Assignees
Labels
[Feature] Patterns A collection of blocks that can be synced (previously reusable blocks) or unsynced [Type] Bug An existing feature does not function as intended

Comments

@Andrew-Starr
Copy link

Description

As of 13.0 the core featured pattern category does not seem to be registered, and the category is missing from the pattern section of the block inserter.

If trying to recreate this issue with Twenty Twenty-Two theme you will need to comment out L17 of /twentytwentytwo/inc/block-patterns.php as this theme registers the category itself.

'featured' => array( 'label' => __( 'Featured', 'twentytwentytwo' ) ),

Prior to Gutenberg 13.0 the core featured category was available without the theme needing to register it, so I'm not sure if this is a bug or whether it is intended.

Step-by-step reproduction instructions

Activate a theme that does not register the featured pattern category
or remove/comment out where the theme is registering the featured category

Edit a post/page, select the 'Patterns' tab in the block inserter.
Notice the core 'Featured' category is missing from the dropdown selector.

Screenshots, screen recording, code snippet

No response

Environment info

WP 5.9.3
Gutenberg 13.0
Twenty Twenty-Two theme, and other themes

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@ndiego ndiego added [Feature] Patterns A collection of blocks that can be synced (previously reusable blocks) or unsynced [Type] Bug An existing feature does not function as intended labels Apr 20, 2022
@ndiego
Copy link
Member

ndiego commented Apr 20, 2022

I have confirmed this. The "Featured" category did used to exist by default. @Mamaduka do you know if something may have changed with the updates to the Patterns API or perhaps the Patterns Directory integration?

@Mamaduka
Copy link
Member

@ndiego, it looks like related to the new API changes.

The category is registered before loading remote patterns. Now, this function is only called via REST API, so it's not available during the normal WP lifecycle.

@ndiego
Copy link
Member

ndiego commented Apr 20, 2022

Hmm, I am on the fence about whether we should consider this a "bug", or simply a "change". It will impact themes that are currently using the "Featured" category without registering it themselves and place patterns in the "Uncategorized" category, but perhaps all categories that a theme wants to use should be registered by the theme itself. 🤔

It's hard to tell if this was an intentional change or an oversight. The easiest solution would be to add it back if possible, but I could be convinced it should not have been registered to begin with.

@Mamaduka
Copy link
Member

Probably an oversight on our part. The category is also used for featured patterns from Patterns Directory.

@ndiego ndiego moved this from Triage to Todo in WordPress 6.0 Editor Tasks Apr 25, 2022
@ndiego
Copy link
Member

ndiego commented Apr 25, 2022

This is an issue we really should try and get resolved for 6.0. I know anecdotally, there are many FSE theme authors that are using the default "featured" category.

cc @annezazu @priethor

@Mamaduka Mamaduka self-assigned this Apr 26, 2022
@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Apr 27, 2022
@Mamaduka Mamaduka moved this from Todo to In Progress in WordPress 6.0 Editor Tasks Apr 27, 2022
Repository owner moved this from In Progress to Done in WordPress 6.0 Editor Tasks Apr 27, 2022
@priethor priethor removed the [Status] In Progress Tracking issues with work in progress label Apr 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Patterns A collection of blocks that can be synced (previously reusable blocks) or unsynced [Type] Bug An existing feature does not function as intended
Projects
No open projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants