Come up with a way to extract pattern-override code from the block-editor package #60619
Labels
[Feature] Synced Patterns
Related to synced patterns (formerly reusable blocks)
[Status] In Progress
Tracking issues with work in progress
[Type] Enhancement
A suggestion for improvement.
What problem does this address?
Originally reported in #60234 (comment).
Pattern Overrides is a WordPress-only feature. It would be nice to extract the logic and code from the block-editor package to maybe the
editor
package instead.What is your proposed solution?
I haven't figured out an elegant way yet but I have some ideas.
Since that we probably shouldn't have multiple menu items with the same label, maybe we can use the label as a key to override the existing ones. For instance, the block-editor package would implement the
Rename
menu item normally without the overrides warning, and we'll give it arename
key.When we try to add a new menu item with the same
rename
key in theeditor
package, then it would simply override the existing ones. This will allow us to implement the warning message there, without leaking WordPress-specific logic to the block-editor package.The text was updated successfully, but these errors were encountered: