-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Description
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 the wp_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
- 1. Add custom taxonomy - PR
- 2. Add UI to the create pattern modal to select a category - PR
- 3. Display the categories in the site editor patterns page - PR
- 4. Display categories in the post editor inserter patterns tab - PR
- 5. Merge the synced patterns into post editor inserter patterns tab - PR
- Once the above PRs are merge retest Quick pattern inserter doesn't include synced patterns or template parts #54180 to make sure it is resolved
- Add additional filtering options to site editor patterns list page, eg. 'My synced patterns, My unsynced patterns, Theme patterns, etc.
- Get the category to save in add pattern model if user doesn't hit enter or
,
- PR merged into Patterns: Add categories to user patterns, and allow filtering by these in site and post editor #53835 - Add ability to edit categories of existing patterns into site editor - PR