| Folder | Short description | Tags | Download .zip | Live Demo |
|---|---|---|---|---|
| 📁 | example-locked-pattern | BLOCK THEME, CURATION |
📦 |
This is a child theme of the Twenty Twenty-Four theme, which is required for this example to work.
The goal of this child theme is to showcase an example of a block pattern that utilizes template locking to only allow the user to edit block content but not edit block settings or styles. To read more about this feature, see the Locking APIs section of the Curation documentation in the Block Editor Handbook.
This child theme adds a custom block pattern named Custom Event (Locked). The only file with code relevant to this example is:
parts/custom-event.php: Registers a custom pattern.
Within that file, the outer wrapping block has its templateLock attribute set to contentOnly, which locks the pattern.