Skip to content
This repository was archived by the owner on Jun 19, 2025. It is now read-only.

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

README.md

Example: Locked Pattern

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.

Understanding the Example Code

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.