| 开发者 | bakhods |
|---|---|
| 更新时间 | 2026年9月25日 15:29 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
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' );
No. The ACF installation is left untouched. A patched copy of one script is generated in the uploads folder and served instead of the original, only inside the admin area.
The patched copy is keyed to the ACF version and rebuilt automatically. If the code it patches has changed too much to recognise, the original script is served and an admin notice asks you to update this plugin.
No. ACF blocks are a PRO-only feature, so there is nothing to patch in the free version.
Nothing. Deleting the plugin removes the generated cache folder in wp-content/uploads/ and the internal flag it uses.
switchEditors.go(), which bookmarks the caret and makes WordPress focus and scroll to it once TinyMCE is ready.acf.model / acf.field.extend() handlers included. Canvas clicks, mousedowns and changes are now handed on to the parent document's jQuery handlers.acf.newTooltip(), so they stayed in the parent document; every ACF tooltip is now moved into the canvas and positioned against the canvas viewport, so it also flips below its target near the top edge like it should.sortstart / sortstop never reached ACF, so the row was not unmounted and remounted around the drag.remove handler, which a block form never reaches - it is unmounted, and the list lives outside the node React drops.<body>, which Select2 - having no font of its own - picked up as well.enqueue_block_assets fires in both places, and on the editor page everything the form needs is already loaded, while the TinyMCE skin added there a second time only got in the way.