English below. Русское описание — ниже, после английского.
On some WordPress builds the block-editor canvas is always rendered inside
<
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:
All three fixes are configurable under Settings Classic Block Editing for ACF,
and every fallback path is safe: if the expected code can’t be located inside
ACF’s script (for example after an ACF update changes its build), the plugin
leaves the original script untouched and shows an admin notice instead of
silently mis-patching anything.
The iframe-detection patch and companion cross-document fixes are adapted
from the open-source plugin
Block Edit Mode for ACF
by Bakhodir Sharipov (GPLv2 or later), which solves the identical problem.
На некоторых сборках WordPress канвас редактора блоков всегда рендерится
внутри <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 на диске, тремя независимыми фиксами (каждый
включается и отключается отдельно):
Все три фикса настраиваются в «Настройки Classic Block Editing for ACF»,
и каждый запасной путь безопасен: если ожидаемый код не удаётся найти
внутри скрипта ACF (например, после обновления ACF изменился его сборочный
результат), плагин оставляет исходный скрипт нетронутым и показывает
уведомление в консоли администратора — вместо тихого неправильного патча.
Патч детектора iframe и кросс-документные правки адаптированы из открытого
плагина
Block Edit Mode for ACF
Bakhodir Sharipov (GPLv2 или новее), который решает ту же задачу.