Skip to content

fix(wp): upload custom fonts without Google Fonts lookup - #50

Merged
DavidBabinec merged 2 commits into
mainfrom
fix/custom-font-import
Oct 27, 2026
Merged

DavidBabinec merged 2 commits into
mainfrom
fix/custom-font-import

Conversation

@DavidBabinec

Copy link
Copy Markdown
Contributor

Fixes #36

The bug

Adding a local font showed a Google Font download error and never reached WordPress's upload endpoint. The import handler replaced uploaded file data with a Google Fonts lookup.

The fix

Preserve custom-font file data and send it through the existing WordPress uploader. Local upload failures now show a custom-font error.

Verification

Reproduced the failure in disposable WordPress using a local WOFF2 file. After the fix, the same file uploaded, loaded in the browser, and remained available after saving and reloading. Both regression tests fail with the original handler.

Web tests: 208 passed; PHP: 48 tests, 116 assertions
Web build and WordPress release build: passed
WordPress Docker E2E: passed
Changed-file Biome check: passed

The shared import handler replaced local file data with a Google Fonts request before the custom-aware uploader could run. Preserve local data and report local upload failures with the right error.
@DavidBabinec
DavidBabinec marked this pull request as ready for review October 27, 2026 10:16
@DavidBabinec
DavidBabinec merged commit a4174ef into main Oct 27, 2026
8 checks passed
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.

[Bug]: Custom Font import fails with "Could not download the selected Google Font" (save handler calls the Google Fonts lookup for custom fonts)

1 participant