跳到内容

Cosmo Block Edit Mode for ACF

v1.0.10

Bakhodir Sh · 2026年8月29日 上架

Brings back the "Switch to Edit / Switch to Preview" toggle and the field form inside ACF blocks, instead of only in the sidebar.

正在使用
1,000+
评分
暂无
累计下载
2,750
最近更新
2026年11月12日
需要 WordPress 6.8+已测试到 7.1.5PHP 7.4+

贡献者

Since the post editor canvas is always rendered inside an iframe, Advanced Custom Fields forces every ACF block into preview mode: the toolbar toggle disappears and the field form is pushed into the sidebar. There is no filter or setting to turn that behaviour off.

This plugin restores the previous experience. The toolbar toggle comes back and the fields are edited in place, inside the block, exactly where the content is.

Cosmo Block Edit Mode for ACF is an independent, unofficial plugin. “ACF” and “Advanced Custom Fields” are trademarks of WP Engine; this plugin is not affiliated with, endorsed by, or sponsored by WP Engine or the Advanced Custom Fields team, and the name refers to that plugin solely to describe what this one works with.

How it works

The plugin builds a patched copy of the ACF blocks script on the fly. The only change is one internal “is the editor iframed?” check, which is made to always return false. The copy is stored in wp-content/uploads/cosmo-block-edit-mode-for-acf/ and its file name is derived from the ACF version and the source file, so it is rebuilt automatically after every ACF update.

If a future ACF release rewrites that part of the code, the plugin silently serves the untouched original and shows a warning in the admin area. Your site never breaks – it simply falls back to the current ACF behaviour.

Some extra styling and a small companion script are loaded inside the canvas iframe, because the iframe does not inherit the wp-admin stylesheets that ACF fields depend on. These also fix everything that breaks once a field lives in a different document than the scripts driving it: select2 dropdowns, tooltip placement, and the WYSIWYG field – TinyMCE, Quicktags, the Visual/Text tabs and the Add Media button.

Requirements

This plugin requires ACF PRO, a commercial plugin sold separately by WP Engine and not distributed through WordPress.org. Blocks are a PRO-only feature. With ACF PRO inactive, this plugin does nothing at all.

This plugin is not affiliated with, endorsed by, or sponsored by WP Engine or the Advanced Custom Fields team.

Developers

Turn the patch off without deactivating the plugin:

add_filter( 'cosmo/block_edit_mode_for_acf/enabled', '__return_false' );

On WordPress 7.1+ the plugin keeps blocks without an explicit block version on the legacy version (1 for acf_register_block_type(), 2 for block.json), because version 3 blocks have no in-block form. To opt a block into version 3, set blockVersion in its block.json or acf_block_version in acf_register_block_type().

Plums

按场景查找 WordPress 插件。安装量、评分和兼容版本来自官方目录。

导航

说明

WordPress 是 WordPress Foundation 的商标。本站与 WordPress Foundation、Automattic 没有隶属关系。这里不托管插件文件,下载和安装以 WordPress.org 上的页面为准。

© 2026 Plums