Skip to content

Patterns: add categories to user created patterns #53164

@glendaviesnz

Description

@glendaviesnz

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

Metadata

Metadata

Assignees

Labels

[Feature] PatternsA collection of blocks that can be synced (previously reusable blocks) or unsynced[Type] EnhancementA suggestion for improvement.[Type] Tracking IssueTactical breakdown of efforts across the codebase and/or tied to Overview issues.

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions