Skip to content

Commit

Permalink
Add a document explaining the different block API versions (#26277)
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad authored Dec 10, 2020
1 parent 292e1d1 commit 5f85bc4
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
12 changes: 12 additions & 0 deletions docs/designers-developers/developers/block-api/versions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Block API Versions

This document lists the changes made between the different API versions.

## Version 2 (>= WordPress 5.6)

- To render the block element wrapper for the block's `edit` implementation, the block author must use the `useBlockProps()` hook.
- The generated class names and styles are no longer added automatically to the saved markup for static blocks when `save` is processed. To include them, the block author must explicitly use `useBlockProps.save()` and add to their block wrapper.

## Version 1

Initial version.
6 changes: 6 additions & 0 deletions docs/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,12 @@
"markdown_source": "../docs/designers-developers/developers/block-api/block-annotations.md",
"parent": "block-api"
},
{
"title": "Block API Versions",
"slug": "versions",
"markdown_source": "../docs/designers-developers/developers/block-api/versions.md",
"parent": "block-api"
},
{
"title": "Filter Reference",
"slug": "filters",
Expand Down
3 changes: 2 additions & 1 deletion docs/toc.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
{ "docs/designers-developers/developers/block-api/block-transforms.md": [] },
{ "docs/designers-developers/developers/block-api/block-templates.md": [] },
{ "docs/designers-developers/developers/block-api/block-patterns.md": [] },
{ "docs/designers-developers/developers/block-api/block-annotations.md": [] }
{ "docs/designers-developers/developers/block-api/block-annotations.md": [] },
{ "docs/designers-developers/developers/block-api/versions.md": [] }
] },
{ "docs/designers-developers/developers/filters/README.md": [
{ "docs/designers-developers/developers/filters/block-filters.md": [] },
Expand Down

0 comments on commit 5f85bc4

Please sign in to comment.