Skip to content

Fix - Editor Google Fonts request returns HTTP 400 and never reaches the block editor - #71

Open
rajatgautam755421 wants to merge 2 commits into
developfrom
fix/63-editor-google-fonts-url
Open

rajatgautam755421 wants to merge 2 commits into
developfrom
fix/63-editor-google-fonts-url

Conversation

@rajatgautam755421

@rajatgautam755421 rajatgautam755421 commented Sep 30, 2026 •

Copy link
Copy Markdown

Closes themegrill/radiate-pro#63

Fixes the editor part of themegrill/radiate-pro#63 (Free).

Two problems made the block editor lose the theme fonts:

  1. Invalid URL. radiate_block_editor_styles() asked for css2?family=Roboto|Merriweather:400,300. The css2 endpoint does not accept that old syntax, so Google answers HTTP 400 and the browser blocks the response.
  2. Wrong hook. Even with a valid URL, styles enqueued on enqueue_block_editor_assets do not reach the block editor iframe, so the fonts still would not apply to the editor text. (Spacious Pro and Zakra document and handle the same thing.)

The fonts stylesheet is now enqueued on enqueue_block_assets (admin only) with a valid CSS2 URL: https://, no &ver=, and the weights the front end already loads (Merriweather 300/400, Roboto 400).

Before (no web fonts in the editor) After (Roboto heading, Merriweather text)
before after

Test

  1. Open Posts, Add New and add a heading and a paragraph.
  2. In DevTools, Network filtered on fonts.googleapis: the request is now 200 (before: 400). The editor text uses Roboto and Merriweather (before: generic fonts).
  3. The front end and other admin screens load the same fonts as before.

Adds a @fresh spec and a block-editor area in the suite manifest: it fails on develop, passes 3/3. Full suite: 11 passed, 5 skipped. PHPCS unchanged (8 errors, 4 warnings both sides). Remote fonts on every page (part 2 of the issue) is not touched.

Changelog: Fix - Editor fonts now load inside the block editor canvas.

…the block editor (themegrill/radiate-pro#63)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

QA suite — passed ✅

All 12 checks passed.

8 passed · 0 failed · 4 skipped · 0 flaky · 16s

Automated check — no AI involved. It runs the tests in this branch.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🔵 Needs a closer look

The font rules remain in the parent admin document and may not style the editor iframe; the editor stylesheet needs an iframe-capable enqueue path.

Review effort: Lite
Findings: None

What changed in this PR

Fixes Google Fonts loading in the block editor by correcting the CSS2 URL and enqueueing fonts for the editor iframe.

Changes:

  • Adds editor-only Merriweather and Roboto loading.
  • Adds an end-to-end regression test.
  • Registers the block-editor QA area.
File Summary
functions.php Corrects editor font loading.
tests/​e2e/​specs/​block-editor/​editor-fonts.spec.ts Tests the iframe font stylesheet.
.themegrill-qa/​suite.json Registers block-editor coverage.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

…o it reaches the iframe (themegrill/radiate-pro#63)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants