Editor stylesheet triggers "added to the iframe incorrectly" warnings in the editors
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 74/100
Hướng nghiên cứu
Bắt đầu tại inc/Core.php dòng 56, nơi assets/css/build/editor.css và các biến Neve inline của nó được enqueue trên enqueue_block_editor_assets. Sau đó kiểm tra hook thiết lập theme đã khai báo hỗ trợ editor-styles, vì bản sửa đổi chuyển việc đăng ký đến đó thông qua add_editor_style() (hoặc sang enqueue_block_assets được bảo vệ bởi is_admin()), giữ CSS inline trên cùng handle. Hoàn tất nghĩa là block editor và Site Editor tải với SCRIPT_DEBUG bật và không hiển thị cảnh báo "added to the iframe incorrectly" trong khi các style của editor vẫn được áp dụng.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- PHP
- Star
- 0
- Fork
- 0
- Merge trung bình
- 22 giờ 12 phút
- Pull request đã merge (30 ngày)
- 6
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Codeinwp/eduacademy
-
bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 84/100
Codeinwp/eduacademy#30 ·
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Codeinwp/eduacademy#29 ·
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Codeinwp/eduacademy#28 ·
-
bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 62/100
Codeinwp/eduacademy#32 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
Codeinwp/eduacademy#6 ·
Tất cả issue của Codeinwp/eduacademy
Issue tương tự
-
Change: check an identifier filter the same way in every tool - the order of somcp_search_ordersĐang mởconsistency enhancement Orders
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
novalo-dev/Prestashop-MCP-Server#343 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
claude
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
sprain/sprainocchio#45 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
sync-en
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
sync-en
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày