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

6.4 Backport: Add a taxonomy for user pattern categories #5234

Closed

Conversation

glendaviesnz
Copy link

@glendaviesnz glendaviesnz commented Sep 18, 2023

Description

Adds a custom taxonomy wp_pattern_category to allow users to assign categories to their custom patterns.

Gutenberg PR .

Trac ticket: https://core.trac.wordpress.org/ticket/59379

Testing Instructions

  • Go to /wp-admin/edit.php?post_type=wp_block and add a new pattern
  • Make sure the Category option appears in the right settings panel and that you can add new categories

Screenshots or screencast

categories.mp4

This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

@Mamaduka
Copy link
Member

@glendaviesnz, do you mind including changes from WordPress/gutenberg#54567 here as well?

@Mamaduka
Copy link
Member

Thank you, @glendaviesnz!

@@ -186,6 +186,8 @@ public function test_expected_routes_in_schema() {
'/wp-site-health/v1/tests/authorization-header',
'/wp-site-health/v1/tests/page-cache',
'/wp-site-health/v1/directory-sizes',
'/wp/v2/wp_pattern_category',
'/wp/v2/wp_pattern_category/(?P<id>[\d]+)',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't able to run this test suite locally for some reason, but the earlier CI failures pointed to these lines being missing so I added them in.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, still failing. Does anything need to be updated on the REST API side to support this taxonomy?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will take a look

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is all that was added in the plugin to make it work https://github.com/WordPress/gutenberg/pull/53163/files

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I run this branch locally going to /wp-admin/edit-tags.php?taxonomy=wp_pattern_category shows the taxonomy and allows you to edit it, but that is not via REST I guess

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ran all the unit tests locally and this regenerated the fixtures file - so hopefully pushing this fixes it.

@glendaviesnz
Copy link
Author

@glendaviesnz, do you mind including changes from WordPress/gutenberg#54567 here as well?

Done @Mamaduka

@glendaviesnz glendaviesnz force-pushed the add/user-pattern-categories branch from 094e58b to 9ec7089 Compare September 20, 2023 09:10
@glendaviesnz
Copy link
Author

glendaviesnz commented Sep 20, 2023

@tellthemachines the remaining test failures don't seem to be related to this PR but I don't have permissions to restart them - are you able to rerun the failed jobs please?

@tellthemachines
Copy link
Contributor

@glendaviesnz thanks for sorting the issue out! I've restarted the e2e tests but they've been failing often on PR branches so it's not really a concern 🤷 as long as all the PHP tests pass we're good.

Copy link
Contributor

@tellthemachines tellthemachines left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes LGTM!

@tellthemachines
Copy link
Contributor

Committed in r56642.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants