-
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: add categories to user created patterns #53164
Comments
@aaronrobertshaw, @kevin940726, @youknowriad, @Mamaduka, @carolinan, @t-hamano let me know if you have any thoughts on whether a standard WP custom taxonomy is the best approach for this or not |
Agreed, taxonomies are more suited for this and are more performant when querying the items vs. post meta. P.S. We should probably drop the |
I too think taxonomy is the way to go. The reason is that the template parts area is also registered as a taxonomy and I think the pattern should be able to have a similar design. |
Have made that change on the PR. In my mind I was thinking of |
+1 to pattern categories via a taxonomy. The querying performance, consistency with template parts, and leveraging of existing features are all compelling reasons to me. |
Taxonomy is correct — the thing I'm worried about is the overlap between semantic template parts and pattern categories, specially given they are separate objects ( |
Thanks for raising the concern about the crossover with template parts @mtias. This overlap was already an issue with the pattern categories that are assigned to .org/theme patterns. This is one of the main reasons the In the short term giving users the ability to add their own patterns to a I agree though that it would be good to have a shared taxonomy so users just see one While we could reuse the existing It seems like the lower-risk option is to proceed with adding the Let me know if you have any different views/thoughts on this. |
This work has been completed and is in GB 16.7 which will be used in the 6.4 beta release |
Overview
Currently, there is no way for users to categorize/arrange their synced and unsynced patterns, they all appear under the 'My patterns' category.
Proposed solution?
Add a WP custom taxonomy called
wp_pattern_category
for thewp_block
CPT.The .org and theme patterns have a category registry, but these categories are generated on load based on the .org and theme patterns that are currently available to the site. There is no way for users to add/save their own categories, or to assign them to the
wp_block
CPT.Options were explored of adding the existing pattern slugs to the
wp_block
CPT postmeta, but there would be performance issues with retrieving all patterns with a given category with this approach, and this also does not allow users to add their own categories.WP taxonomies are a standard way to allow categorization of custom CPTs, and all the add/update/search functionality already exists, so this seems like the best way to add this functionality.
N.B. Tasks 2-5 below should all go into the same release, so ideally should be merged only when all 6 are ready to go
#53835 is the parent PR
#53837 & #53933 are branched off #53835
#54007 is branched off #53933
so merge order should be #54007, #53933, #53837, #53835
Tasks
,
- PR merged into Patterns: Add categories to user patterns, and allow filtering by these in site and post editor #53835The text was updated successfully, but these errors were encountered: