Repository navigation
Revert editor style changes made with WP 7.0 upgrade - #572
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
It removes the admin SVG sprite source (#tms-icons-sprite) while the admin bundle still includes logic that depends on it for editor iframe sprite syncing.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
This PR aims to revert block editor styling behavior introduced during the WP 7.0 upgrade by removing the editor-canvas (iframe) settings injection and switching back to enqueueing dedicated editor.css/editor.js assets for the block editor.
Changes:
- Removed the
block_editor_settings_allfilter that injected front-end/theme CSS into the editor canvas viasettings['styles']. - Updated
enqueue_block_editor_assetshandling to enqueueeditor.cssand (optionally)editor.jsfrom/assets/dist. - Removed admin footer SVG sprite injection used for editor iframe sprite syncing.
File summaries
| File | Description |
|---|---|
| lib/Assets.php | Removes editor-canvas settings injection and admin SVG sprite injection; reverts to enqueueing editor CSS/JS assets directly. |
Review details
Suppressed comments (1)
lib/Assets.php:313
assets/scripts/admin-svg-sprite.jsdepends on an element with idtms-icons-spritebeing present in admin to copy the sprite into the editor canvas iframe. This PR removes theinclude_admin_svg_icons()helper that provided that markup, leaving the sprite-copy logic without a source element.
}
}
/**
* This enables cache busting for theme CSS and JS files by
- Files reviewed: 1/1 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| \add_action( | ||
| 'enqueue_block_editor_assets', | ||
| \Closure::fromCallable( [ $this, 'editor' ] ) | ||
| ); |
There was a problem hiding this comment.
@copilot I removed the import from admin.js, does this resolve this problem?
There was a problem hiding this comment.
Yes — for the sprite-sync issue in that thread, removing the admin-svg-sprite import resolves it, because admin.js no longer runs the code that depends on #tms-icons-sprite. The separate concern about editor() asset enqueueing is independent of this change.
There was a problem hiding this comment.
@copilot We need to remove all customizations of styles in editor view for now. Does it still need a closer look with this in mind?
There was a problem hiding this comment.
🔵 Needs a closer look
The new editor() implementation conditionally skips enqueuing editor assets based on local file_exists, which can silently disable editor JS/CSS in some deployment setups.
Review details
Suppressed comments (1)
Previously missed (1) — in code that hasn't changed since the last review.
lib/Assets.php:230
editor()conditionally enqueues editor assets only when the compiled files exist on the local filesystem (file_exists(DPT_ASSET_CACHE_URI ...)). This is inconsistent with the rest of the asset enqueues in this class (theme/admin/vendor), which always enqueue and rely on versioning/fallbacks. Thefile_existsgates can cause the editor JS/CSS to silently not load in environments where assets are served from a different location than the filesystem path (e.g., symlinks, deployments with CDN URLs, or filtered asset paths).
- Files reviewed: 2/2 changed files
- Comments generated: 0 new
- Review effort level: Lite
Co-authored-by: eebbi <31741222+eebbi@users.noreply.github.com>
No description provided.