Skip to content

Commit 88fa486

Browse files
committed
Add documentation and schema for contentRole block support
1 parent 6f1d4e2 commit 88fa486

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

docs/reference-guides/block-api/block-supports.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -608,6 +608,22 @@ When the block declares support for `color.text`, the attributes definition is e
608608
}
609609
```
610610

611+
### contentRole
612+
613+
_**Note:** Since WordPress 6.9._
614+
615+
- Type: `boolean`
616+
- Default value: `true`
617+
618+
This value signals that a block contains user-editable content. When set to true, the block is considered a content block. Content blocks remain editable even when their parent container has content-only locking applied.
619+
620+
```js
621+
supports: {
622+
// Declare support for content role.
623+
contentRole: true
624+
}
625+
```
626+
611627
## customClassName
612628

613629
- Type: `boolean`

schemas/json/block.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -650,6 +650,11 @@
650650
"description": "This property indicates whether the block can split when the Enter key is pressed or when blocks are pasted.",
651651
"type": "boolean",
652652
"default": false
653+
},
654+
"contentRole": {
655+
"description": "This value signals that a block contains user-editable content. When set to true, the block is considered a content block. Content blocks remain editable even when their parent container has content-only locking applied.",
656+
"type": "boolean",
657+
"default": false
653658
}
654659
},
655660
"additionalProperties": true

0 commit comments

Comments
 (0)