-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Ensure font-face styles are printed in iframe editors. #54313
Ensure font-face styles are printed in iframe editors. #54313
Conversation
Gutenberg overrides Core's _wp_get_iframed_editor_assets() styles results. As Font Face is merged into Core, wp_print_font_faces() was not being invoked. This commit ensures it is invoked for printing the `@font-face` styles in the iframed editors.
This pull request has changed or added PHP files. Please confirm whether these changes need to be synced to WordPress Core, and therefore featured in the next release of WordPress. If so, it is recommended to create a new Trac ticket and submit a pull request to the WordPress Core Github repository soon after this pull request is merged. If you're unsure, you can always ask for help in the #core-editor channel in WordPress Slack. Thank you! ❤️ View changed files❔ lib/compat/wordpress-6.4/fonts/fonts.php ❔ lib/load.php |
Thanks for the PR! Test ReportSteps to Test
Environment
Actual ResultsReproduce Issue
Test Patch
Supplemental Artifacts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me. I've got one small comment question, but it's not worth holding things up, as it'll be obvious when merging to Core.
Test ReportEnvironment
Steps to Test
Expected Results
Actual Results
|
@anton-vlasenko did you set the define( 'FONT_LIBRARY_ENABLE', true ); This constant turns on the Font Library and Font Face code in the plugin and turns off the Fonts API. |
Test ReportEnvironment
Steps to Test
Expected Results
Actual Results
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After retesting the PR with the FONT_LIBRARY_ENABLE
constant set to enabled, it functions as intended: #54313 (comment)
LGTM!
What?
In the plugin, ensure
wp_print_font_faces()
is invoked and added to the iframed editors' styles.Why?
Gutenberg overrides Core's
_wp_get_iframed_editor_assets()
styles results. Font Face'swp_print_font_faces()
is in Core's_wp_get_iframed_editor_assets()
. But Gutenberg overrides the results of that function in_gutenberg_get_iframed_editor_assets()
(for WP 6.3) and_gutenberg_get_iframed_editor_assets_6_4()
(for WP 6.4).How?
Loads the plugin's
fonts.php
file and moves the hooked code for'block_editor_settings_all'
out of the guard.Testing Instructions
FONT_LIBRARY_ENABLE
constant totrue
in your test site'sconfig.php
:wp-fonts-local
.Expected: After applying this PR, it should also exist in the
iframe
.