Skip to content

Revert editor style changes made with WP 7.0 upgrade - #572

Merged
eebbi merged 4 commits into
masterfrom
revert-editor-style-changes
Sep 18, 2026
Merged

eebbi merged 4 commits into
masterfrom
revert-editor-style-changes

Conversation

@eebbi

@eebbi eebbi commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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_all filter that injected front-end/theme CSS into the editor canvas via settings['styles'].
  • Updated enqueue_block_editor_assets handling to enqueue editor.css and (optionally) editor.js from /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.js depends on an element with id tms-icons-sprite being present in admin to copy the sprite into the editor canvas iframe. This PR removes the include_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.

Comment thread lib/Assets.php
Comment on lines 45 to 48
\add_action(
'enqueue_block_editor_assets',
\Closure::fromCallable( [ $this, 'editor' ] )
);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot I removed the import from admin.js, does this resolve this problem?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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?

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 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. The file_exists gates 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>
@eebbi
eebbi merged commit 74d0665 into master Sep 18, 2026
3 of 5 checks passed
@eebbi
eebbi deleted the revert-editor-style-changes branch September 18, 2026 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants