| 开发者 |
Shaadan
shaadan |
|---|---|
| 更新时间 | 2026年9月11日 05:24 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
<iframe name="editor-canvas">, instead of only for block themes, non-desktop
previews, or apiVersion 3+ blocks as it used to be. Advanced Custom Fields
(ACF) itself contains a check for that iframe and, whenever it finds one,
unconditionally forces every ACF block into read-only Preview mode and hides
the classic "Switch to Edit / Switch to Preview" toolbar button — regardless
of the block's own acf_block_version.
This plugin restores that classic toggle without modifying any ACF or
WordPress core file on disk, using three independent, individually toggleable
fixes:
<iframe name="editor-canvas"> — а не только для блочных тем,
мобильного превью или блоков с apiVersion 3+, как было раньше. В самом
Advanced Custom Fields (ACF) есть проверка на этот iframe: обнаружив его,
ACF безусловно переводит каждый ACF-блок в режим «только просмотр» (Preview)
и прячет классическую кнопку-переключатель «Switch to Edit / Switch to
Preview» на панели инструментов блока — независимо от его собственного
acf_block_version.
Плагин возвращает этот классический переключатель, не изменяя ни одного
файла ACF или ядра WordPress на диске, тремя независимыми фиксами (каждый
включается и отключается отдельно):
/wp-content/plugins/rozmuar-classic-block-editing-for-acf
directory, or install the plugin through the WordPress plugins screen
directly./wp-content/plugins/rozmuar-classic-block-editing-for-acf или установите
плагин прямо через экран «Плагины» в WordPress.The iframe-detection function lives entirely inside ACF's own compiled, minified JavaScript bundle with no PHP-side filter or JS hook exposed for it. The only way to change its behavior is to modify the JavaScript itself, which this plugin does at runtime, on a cached copy, without ever touching ACF's files on disk.
No. It reads ACF's currently-registered script, writes a patched copy to
wp-content/uploads/acf-classic-block-editing/, and serves that copy instead
via the script_loader_src filter. ACF's own files are never written to.
The cached patched copy is keyed by the source file's path, modification time and size, so it is regenerated automatically the next time the editor loads after an ACF update.
The plugin leaves the original ACF script completely untouched and displays an admin notice, rather than guessing or applying a partial/incorrect patch.
Функция-детектор iframe целиком находится внутри скомпилированного минифицированного JS-бандла ACF, и для неё не предусмотрено ни PHP-фильтра, ни JS-хука. Единственный способ изменить её поведение — менять сам JavaScript, что плагин и делает во время выполнения, на кэшированной копии, ни разу не трогая файлы ACF на диске.
Нет. Он читает зарегистрированный скрипт ACF, пишет пропатченную копию в
wp-content/uploads/acf-classic-block-editing/ и отдаёт её вместо оригинала
через фильтр script_loader_src. В файлы самого ACF запись никогда не
ведётся.
Ключ кэша пропатченной копии складывается из пути, времени изменения и размера исходного файла, поэтому копия автоматически пересобирается при первой же загрузке редактора после обновления ACF.
Плагин полностью оставляет исходный скрипт ACF нетронутым и показывает уведомление в админке — вместо догадок или частичного/неверного патча.
rozmuar-classic-block-editing-for-acf,
per the WordPress.org review team's note that a third-party integration
needs a distinctive name of its own ahead of "... for Advanced Custom
Fields" — "Classic Block Editing for Advanced Custom Fields" (4.4.0) still
led with the ACF name once "for" was dropped. This is the permalink to be
assigned for the plugin's WordPress.org listing. No functional changes.acf-classic-block-editing,
already assigned by WordPress.org, and was never meant to change — an
in-progress edit briefly changed it to classic-block-editing-for-acf
before this release. Reverted the Text Domain header, every
__()/esc_html_e() domain argument, the cache directory, and the
enqueued script/style handle names back to acf-classic-block-editing.
The display name introduced in 4.4.0 is unaffected.acf-classic-block-editing), already assigned by WordPress.org, is
unchanged. No functional changes..form value in the runtime JS patch. ACF
PRO ships .form as a boolean while its own bundle treats it as a string,
which crashed every ACF block ("This block has encountered an error") and
printed a stray "true" in the block sidebar once the iframe detection was
neutralized. The mismatched value is now coerced to an empty string.mode = 'edit' when a block is capped to the classic UI, so
the Edit/Preview toolbar button reappears (it is hidden whenever mode
resolves to "auto"). Overridable via the
acf_classic_block_editing_forced_mode filter.api_version for PHP block registrations, and move that
adjustment out from behind an acf_block_version >= 3 check that never
passed for JSON-registered blocks.acf.blockVersion / acf.mode in the raw block.json
metadata (block_type_metadata, priority 5) before ACF reads it, so the
client-side editor and the server agree and the classic toggle component
is mounted instead of the Block Version 3 "Expanded Editor".acf-classic-block-editing text domain (fixes a TextDomainMismatch check).