This block is experimental and may change or be removed without notice.
Summarize your post with a list of headings. Add HTML anchors to Heading blocks to link them here.
- Name:
core/table-of-contents - Category: design
- API Version: 3
- Block Type: Dynamic (server-rendered)
- Keywords:
document outline,summary
Attributes
Defined via the attributes property in block.json.
| Attribute | Type | Default | Description |
|---|---|---|---|
onlyIncludeCurrentPage |
boolean |
false |
— |
maxLevel |
number |
— | — |
ordered |
boolean |
true |
— |
Supports
Defined via the supports property in block.json.
anchor:trueariaLabel:truehtml:falsebackground:backgroundImage:truebackgroundSize:truegradient:true
color:text:truebackground:truegradients:truelink:true
shadow:truespacing:margin:truepadding:true
typography:fontSize:truelineHeight:truetextAlign:true
interactivity:clientNavigation:true
Context
Defined via the usesContext and providesContext properties in block.json.
Uses context:
postIdpostType
Block Markup
This is a dynamic block. It is rendered on the server and does not save HTML in post content.
In post content, it is stored as a block comment:
<!-- wp:table-of-contents {"maxLevel":3,"ordered":false} /-->
Source
- block.json (reference)
- Source directory — browse the
editandsavesource files,index.php, and more.