-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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: Refactor pattern categories to use existing endpoint to merge in user categories #55822
Conversation
This pull request has changed or added PHP files. Please confirm whether these changes need to be synced to WordPress Core, and therefore featured in the next release of WordPress. If so, it is recommended to create a new Trac ticket and submit a pull request to the WordPress Core Github repository soon after this pull request is merged. If you're unsure, you can always ask for help in the #core-editor channel in WordPress Slack. Thank you! ❤️ View changed files❔ lib/compat/wordpress-6.5/class-gutenberg-rest-block-pattern-categories-controller.php ❔ lib/compat/wordpress-6.5/rest-api.php ❔ lib/load.php |
Size Change: -26 B (0%) Total Size: 1.7 MB
ℹ️ View Unchanged
|
Flaky tests detected in 3815ce3. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/6764847336
|
4b3f7d5
to
3a4d6c8
Compare
There will be a bit of work in adding additional php unit tests to cover this endpoint change as the taxonomy terms will need to be mocked, so I will wait until this approach is approved and then add additional tests to cover it. |
I have converted this back to draft while I explore the change to the API suggested here. |
Closing for now. |
What?
Merges the user and theme pattern categories in the
/v2/block-patterns/categories
endpoint instead of merging them in multiple places in the UIWhy?
Currently, the merging of these categories is duplicated in the block and site editor. It would be better to handle this in a single place, and it makes sense to do it on the API endpoint.
How?
In order to maintain backwards compat with the existing selectors a new resolver and selector is added for
getAllPatternCategories
and the endpoint has been modified to only return the user categories and additional fields if explicitly specified in the request.There is a corresponding PR to port the changes to the API endpoint to core here.
Testing Instructions
Patterns
tab, and that the new custom categories also appear in thePatterns
tab with the correct patterns listed+
option at top of navigation and make sure new categories appear in the left category panel after adding