Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a document explaining the different block API versions #26277

Merged
merged 2 commits into from
Dec 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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": [] }
gziolo marked this conversation as resolved.
Show resolved Hide resolved
] },
{ "docs/designers-developers/developers/filters/README.md": [
{ "docs/designers-developers/developers/filters/block-filters.md": [] },
Expand Down