Iframed Editor Changes in WordPress 7.0

Previous posts on this topic:

Current Situation

  • All editors except the post editor (site editor, template editor, all blockBlock Block is the abstract term used to describe units of markup that, composed together, form the content or layout of a webpage using the WordPress editor. The idea combines concepts of what in the past may have achieved with shortcodes, custom HTML, and embed discovery into a single consistent API and user experience., template and device previews) are currently already iframed unconditionally.
  • The post editor is currently only iframed in coreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. if all registered blocks (across all plugins) use block APIAPI An API or Application Programming Interface is a software intermediary that allows programs to interact with each other and share data in limited, clearly defined ways. version 3 (or higher).
  • When GutenbergGutenberg The Gutenberg project is the new Editor Interface for WordPress. The editor improves the process and experience of creating new content, making writing rich content much simpler. It uses ‘blocks’ to add richness rather than shortcodes, custom HTML etc. https://wordpress.org/gutenberg/ is active with a block-based theme, the post editor is forced to be iframed regardless of block API versions used.

What’s Changing in WordPress 7.0 (#75187)

Instead of checking the registered blocks across all plugins, only the block API versions of blocks that are actually inserted in the post will now be checked. If all blocks inserted are version 3 or higher, the post editor will be iframed. If not, the iframeiframe iFrame is an acronym for an inline frame. An iFrame is used inside a webpage to load another HTML document and render it. This HTML document may also contain JavaScript and/or CSS which is loaded at the time when iframe tag is parsed by the user’s browser. will be removed to ensure the lower-versioned blocks are guaranteed to work. Block authors are encouraged to upgrade their blocks to version 3.

Enforcement in the Gutenberg PluginPlugin A plugin is a piece of software containing a group of functions that can be added to a WordPress website. They can extend functionality or add new features to your WordPress websites. WordPress plugins are written in the PHP programming language and integrate seamlessly with WordPress. These can be free in the WordPress.org Plugin Directory https://wordpress.org/plugins/ or can be cost-based plugin from a third-party. (#75475)

While the iframe is already enforced for block-based themes, it will now also enforced for classic themes from Gutenberg plugin version 22.6. (Note that the post editor may already have been iframed with classic themes if all registered blocks met the required block API version.) Most blocks that are version 2 and lower are expected to work fine, and the enforcement in the plugin is to gather feedback on specific cases where blocks might break before attempting to roll out iframe enforcement in future versions of WordPress. Please comment below if you are affected and the team will help with a solution.

Please note that the iframe is NOT enforced in WordPress 7.0! The timeline to enforce it has been revised in favor of a more gradual rollout to allow more time and feedback.

Thank you to @mamaduka, @wildworks and @mcsf for reviewing.

#7-0, #dev-notes