Editor stylesheet triggers "added to the iframe incorrectly" warnings in the editors
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Anfängerfreundlichkeit
- 74/100
Rechercherichtung
Beginne bei inc/Core.php Zeile 56, wo assets/css/build/editor.css und seine inline Neve-Variablen über enqueue_block_editor_assets enqueued werden. Prüfe dann den Theme-Setup-Hook, der bereits Unterstützung für editor-styles deklariert, da der Fix die Registrierung über add_editor_style() dorthin verschiebt (oder auf enqueue_block_assets, abgesichert durch is_admin()), wobei das inline CSS am selben Handle bleibt. Fertig bedeutet, dass Block-Editor und Site-Editor mit aktiviertem SCRIPT_DEBUG laden und keine Warnungen "added to the iframe incorrectly" anzeigen, während die Editor-Styles weiterhin angewendet werden.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Description
The theme's editor stylesheet is added the outdated way, so every time the block editor or the Site Editor opens, the browser console shows:
eduacademy-editor-css was added to the iframe incorrectly. Please use block.json or enqueue_block_assets to add styles to the iframe.
eduacademy-editor-inline-css was added to the iframe incorrectly. Please use block.json or enqueue_block_assets to add styles to the iframe.
inc/Core.php line 56 enqueues assets/css/build/editor.css (and the Neve-inherited inline CSS attached to it) on enqueue_block_editor_assets. That hook loads assets for the editor's outer page, not the iframed canvas. WordPress copies the styles into the canvas for now, and warns that this fallback is going away. Once it does, the editor would lose the theme's editor styles.
Step-by-step reproduction instructions
- With Eduacademy 1.0.1 active and
SCRIPT_DEBUGon (the warning prints with development scripts), open any page in the block editor, or Appearance → Editor. - Open the browser console.
Expected: no warning about Eduacademy's styles.
Actual: the two "added to the iframe incorrectly" warnings above, on every editor load.
Screenshots, screen recording, code snippet or Help Scout ticket
Fix suggestion: register the editor stylesheet for the canvas with add_editor_style() on after_setup_theme (the theme already declares editor-styles support). Alternatively, enqueue it on enqueue_block_assets guarded by is_admin(), and attach the inline Neve variables to that handle.
Found while adding Eduacademy to the WordPress compatibility checks (Codeinwp/qa-compatibility#168). The warning shows on WordPress 7.0.9, 7.1-RC1 and 7.1.5 alike.
Environment info
Eduacademy 1.0.1 (built from the v1.0.1 tag), WordPress 7.0.9 / 7.1-RC1 / 7.1.5, PHP 8.3, SCRIPT_DEBUG on, Chromium.
Is the issue you are reporting a regression
No
- Vorherrschende Sprache
- PHP
- Sterne
- 0
- Forks
- 0
- Ø Merge
- 22 Std. 12 Min.
- Gemergte PRs (30 T.)
- 6
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Kein Beitragsleitfaden
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus Codeinwp/eduacademy
-
bug
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 84/100
Codeinwp/eduacademy#30 ·
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Codeinwp/eduacademy#29 ·
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Codeinwp/eduacademy#28 ·
-
bug
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 62/100
Codeinwp/eduacademy#32 ·
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 35/100
Codeinwp/eduacademy#6 ·
Alle Issues in Codeinwp/eduacademy
Ähnliche Issues
-
Change: check an identifier filter the same way in every tool - the order of somcp_search_ordersOffenconsistency enhancement Orders
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 88/100
novalo-dev/Prestashop-MCP-Server#343 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
Maintainer antworten meist innerhalb von 1 Tag
-
claude
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
sprain/sprainocchio#45 ·
Maintainer antworten meist innerhalb von 1 Tag
-
sync-en
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 85/100
Maintainer antworten meist innerhalb von 1 Tag
-
sync-en
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 85/100
Maintainer antworten meist innerhalb von 1 Tag