-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Local font asset files not loading in post Editor when metaboxes are enabled (i.e. Editor is not iframed) #51209
Comments
This issue will be resolved with Font Face, which is replacing the Fonts API. |
I'm closing this issue. Why? No further work will happen on the Fonts API. Why? It is being replaced by Font Face and will be removed when Font Library is merged. |
I'm not seeing where this issue was directly introduced within the Fonts API itself. @ndiego reported the issue still exists with the new Font Face generator and printer. Since it exists in both the Fonts API and new Font Face, I suspect the root cause is not within either. I'm reopening this issue to capture the discussion, investigation, and separate resolving PR. |
Thanks @hellofromtonya. I just know that this is going to impact a LOT of people, given the popularity of tools like Yoast and ACF (both of which use metaboxes). My guess is something related to the relatively recent work on iframing the Post Editor is the culprit. Any ideas @ellatrix? |
More context to help:
Nick notes the metabox regression was introduced during WordPress 6.3 beta cycle. Neither the Fonts API nor the new Font Face have been merged into WordPress 6.3. Rather, WordPress Core is still using the stopgap code from WP 6.0.0 (i.e. Something else is the culprit / root cause, some other backport to Core introduced during the 6.3 cycle is causing this regression. Note: If the fix for the root cause also requires a change to be made in the What's the next step? Identify the PR(s) merged into Gutenberg or the backport in WordPress Core that introduced the regression. This step will take some testing and investigation. |
Applying the approach described in #51770 (comment) should fix this issue. I've just tested that it works. |
Test Report for WordPress Core onlyEnv
Note: the Gutenberg plugin is deactivated in this test report. Set up in Site Editor
Here is what the font looks like on Google Fonts: Test ResultsScenario 1: No metaboxesIBM Plex Mono font:
Scenario 2: With metaboxes (from Yoast SEO plugin)IBM Plex Mono font:
SummaryWordPress Core's current trunk via
|
I can confirm with |
Test Report 2: With GutenbergNext, this test report repeats my above tests but with the Gutenberg plugin activated. Test Report for WordPress Core onlyEnv
Set up in Site Editor
Here is what the font looks like on Google Fonts: Test ResultsScenario 1: No metaboxesIBM Plex Mono font:
Scenario 2: With metaboxes (from Yoast SEO plugin)IBM Plex Mono font:
SummaryWith metaboxes (such as from Yoast SEO plugin):
The regression is in Gutenberg, but not in WordPress Core 6.3 Beta 3. |
Why are the tl;dr I was wrong. The regression is in the Fonts API. The change that introduced the regression in Gutenberg:
The hook to print them into the main doc's gutenberg/lib/experimental/fonts-api/fonts-api.php Lines 34 to 36 in 68fa80a
This was done for performance to avoid printing the Commenting out the The new Font Face implementation replacing the Fonts API also resolves the regression. As the Font Face is not yet merged into Gutenberg, I'll create a quick fix PR to remove the guarding in |
PR #52343 should resolve this regression in Gutenberg. @ndiego @anton-vlasenko can you test the PR please to confirm it does resolve it for you? |
Description
#51178 fixed a bug in 15.9 that prevented fonts included in themes to be loaded in the Editor, both post and Site Editor. This was due to a change in #50875.
While #51178 fixed the issue when the Editor is iframed, if a plugin registers metaboxes, the Editor is no longer iframed. As a result, the fonts are no longer loaded.
cc @hellofromtonya @ellatrix
Step-by-step reproduction instructions
Screenshots, screen recording, code snippet
Environment info
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: