wp-block-editor-iframe-compatibility
Installation
SKILL.md
WordPress Block Editor Iframe Compatibility
In WordPress 7.1, the post editor's content canvas is always rendered in an iframe. This no longer depends on the active theme, the current content, or whether every inserted block declares API version 3. Editor-shell controls and block content therefore live in different documents.
Identify the target surface first
| Surface | Typical code | Asset/API choice |
|---|---|---|
| Editor shell/sidebar/toolbar | Plugin sidebar, notices, inspector panels | enqueue_block_editor_assets, WordPress components/data APIs |
| Canvas content | Block markup and content-facing styles | block metadata style/editorStyle, enqueue_block_assets where appropriate |
| Frontend | Saved/dynamic block output | block metadata style, render.php/callback, frontend enqueue |
Do not solve a canvas problem by globally injecting assets into the parent admin document, or a sidebar problem by loading code into every block content context.
Stop treating global document as the canvas
In an editor extension bundle, window and document normally refer to the parent editor shell. Derive the correct browsing context from the element you own: