Title: Post Editor iframing with meta boxes in WordPress 6.7
Author: Mitchell Austin
Published: October 18, 2024

---

 [  ](https://profiles.wordpress.org/presstoke/) [Mitchell Austin](https://profiles.wordpress.org/presstoke/)
2:19 pm _on_ October 18, 2024     
Tags: [6-7 ( 75 )](https://make.wordpress.org/core/tag/6-7/),
[dev-notes ( 654 )](https://make.wordpress.org/core/tag/dev-notes/), [dev-notes-6-7 ( 15 )](https://make.wordpress.org/core/tag/dev-notes-6-7/)

# Post Editor iframing with meta boxes in WordPress 6.7

After an effort to [iframe the post editor](https://github.com/WordPress/gutenberg/issues/33346),
the presence of metaMeta Meta is a term that refers to the inside workings of a 
group. For us, this is the team that works on internal WordPress sites like WordCamp
Central and Make WordPress. boxes was a holdout condition that kept the editor content
from loading in an 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. and made these benefits of the iframe
unavailable:

 * Isolation of 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. and theme CSSCSS Cascading Style Sheets. from the editor
   UIUI User interface
 * Accuracy of media queries and viewport relative CSS units

Those benefits are important to support CSS reuse across the editor and front-end
and generally ease block and theme development. It’s been an ongoing effort to bring
them to the Post editor even when meta boxes are present yet it has taken [a](https://github.com/WordPress/gutenberg/pull/34105)
[few](https://github.com/WordPress/gutenberg/pull/59242) [attempts](https://github.com/WordPress/gutenberg/pull/64247)
to determine how to adapt the interface to separate the meta boxes from the post
content.

Now a [split view is implemented](https://github.com/WordPress/gutenberg/pull/64351)
that supports both editor content and meta boxes being visible together. This change
ensures consistent WYSIWYGWhat You See Is What You Get What You See Is What You 
Get. Most commonly used in relation to editors, where changes made in edit mode 
reflect exactly as they will translate to the published page. experience between
the Editor and front-end views. Additionally, it makes the meta boxes are more readily
available than before and allows visually referencing any part of the post content
while working with any meta box or vice versa.

## Remaining exception to the iframe

For now, the last condition which prevents the iframe from always being used is 
whether any blocks are registered with their `apiVersion` less than `3`. Yet even
this condition may be removed in a future release and it already has an exception
if your site uses the 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/](https://wordpress.org/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/](https://wordpress.org/plugins/)
or can be cost-based plugin from a third-party. and a block based theme is active.

## Edge cases and compatibility

Developers of plugins that add meta boxes should be wary of two things. One, the
meta box container now clips overflowing elements so some popover-like UI such as
dropdown menus will be cut off if they extend upward from the meta box container.
However, if they’re rendered into a part of the DOM outside the container this won’t
be an issue. Two, if your plugin also adds any rich text formats with editing UI
that’s anchored to the text selection then their implementation has to be compatible
with the iframe. This isn’t a new requirement but may have been overlooked for plugins
only extending the Post editor.

### Overflow clipping

To ensure this isn’t an issue any popover-like UI can be made to open downward in
the meta box or by rendering the popover into a part of the DOM that is not within
the meta box container. The latter, for instance, is how the `Popover`, `Dropdown`
and `DropDownMenu` components from `@wordpress/components` work by default and using
them will ensure there is no clipping even if the UI extends beyond the top of the
meta box container.

### Rich Text Format UI anchoring

This is may only be of concern if your plugin implemented custom code to anchor 
or position the UI. If your plugin is already using the recommended `useAnchor` 
hook available from `@wordpress/rich-text` everything should just work. In case 
it’s not, you can reference Gutenberg’s own [link editing UI](https://github.com/WordPress/gutenberg/blob/179cffad3e7719c5ac0396d0009327253db16d17/packages/format-library/src/link/inline.js)
component for a canonical example of its usage.

_Props _[@fabiankaegy](https://profiles.wordpress.org/fabiankaegy/) _and _[@faguni22](https://profiles.wordpress.org/faguni22/)_
for review and proofreading._

[#6-7](https://make.wordpress.org/core/tag/6-7/), [#dev-notes](https://make.wordpress.org/core/tag/dev-notes/),
[#dev-notes-6-7](https://make.wordpress.org/core/tag/dev-notes-6-7/)

### Share this:

 * [  Threads ](https://make.wordpress.org/core/2024/10/18/post-editor-iframing-with-meta-boxes-in-wordpress-6-7/?share=threads)
 * [  Mastodon ](https://make.wordpress.org/core/2024/10/18/post-editor-iframing-with-meta-boxes-in-wordpress-6-7/?share=mastodon)
 * [  Bluesky ](https://make.wordpress.org/core/2024/10/18/post-editor-iframing-with-meta-boxes-in-wordpress-6-7/?share=bluesky)
 * [  X ](https://make.wordpress.org/core/2024/10/18/post-editor-iframing-with-meta-boxes-in-wordpress-6-7/?share=x)
 * [  Facebook ](https://make.wordpress.org/core/2024/10/18/post-editor-iframing-with-meta-boxes-in-wordpress-6-7/?share=facebook)
 * [  LinkedIn ](https://make.wordpress.org/core/2024/10/18/post-editor-iframing-with-meta-boxes-in-wordpress-6-7/?share=linkedin)

 1. ![](https://secure.gravatar.com/avatar/f46487378e3682e0d5f0846f26ed46310740fc1c161b3282b99e5444d742f36a?
    s=32&d=mm&r=g)
 2.  [Sören Wünsch](https://profiles.wordpress.org/soean/)  9:50 am _on_ October 25,
    2024
 3. I have found out that it doesn’t work with relative image paths, see [https://github.com/WordPress/gutenberg/issues/54262](https://github.com/WordPress/gutenberg/issues/54262)
 4.  * ![](https://secure.gravatar.com/avatar/05114ba2a00b363f760f3a745f8f343ec8ad2579b60b7e0c21c2658b305d51c6?
       s=32&d=mm&r=g)
     *  [Mitchell Austin](https://profiles.wordpress.org/presstoke/)  6:56 pm _on_ 
       October 28, 2024
     * It looks like that is an existing issue related to the editor 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. and so can be made more prevalent due to this change.
     * For anyone who encounters this, it seems there is a workaround by setting a `
       [<base>](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base)`. It
       could probably be added to a theme or hooked in via a 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/](https://wordpress.org/plugins/)
       or can be cost-based plugin from a third-party.. I haven’t tested that, just
       going off [this slack discussion](https://wordpress.slack.com/archives/C02QB2JS7/p1729846992621109).
 5. ![](https://secure.gravatar.com/avatar/3c29ccc54d84ece0c12cc97cc91d15d3c58a223c7422b92013222e312a58f580?
    s=32&d=mm&r=g)
 6.  [janne09](https://profiles.wordpress.org/janne09/)  9:54 am _on_ January 8, 2025
 7. If I delete it, how can I restore it?

Comments are closed.

# Post navigation

[← Extending the Preview Dropdown Menu in WordPress 6.7](https://make.wordpress.org/core/2024/10/18/extending-the-preview-dropdown-menu-in-wordpress-6-7/)

[Auto Sizes for Lazy Loaded Images in WordPress 6.7 →](https://make.wordpress.org/core/2024/10/18/auto-sizes-for-lazy-loaded-images-in-wordpress-6-7/)