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

Docs: Add Block API Version 3 #53046

Merged
merged 3 commits into from
Jul 28, 2023
Merged
Changes from 1 commit
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
3 changes: 3 additions & 0 deletions docs/reference-guides/block-api/block-api-versions.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

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

## Version 3 (>= WordPress 6.3)
- The post editor will be iframed if all registered blocks have a Block API version 3 or higher. Adding version 3 support means that the block should work inside an iframe, though the block may still be rendered outside the iframe if not all blocks support version 3.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for adding this :)

I think we should also note that the block editor gets only iframed if all blocks use apiVersion 3 and also no classic meta boxes like for example Yoast SEO are rendered…

That threw me when I ran into this updating all our blocks to get to this state

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the addition.

shouldIframe={
	( 
		( hasV3BlocksOnly || ( isGutenbergPlugin && isBlockBasedTheme ) ) 
		&& ! hasMetaBoxes 
	) 
	|| isTemplateMode 
	|| deviceType === 'Tablet' 
	|| deviceType === 'Mobile'
}

https://github.com/WordPress/gutenberg/blob/trunk/packages/edit-post/src/components/visual-editor/index.js#L357C7-L364C8


## 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.
Expand Down