Font Face: Adds a GB specific resolver to capture changes not yet in Core#54990
Font Face: Adds a GB specific resolver to capture changes not yet in Core#54990hellofromtonya wants to merge 2 commits intotrunkfrom
Conversation
|
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/font-face/class-gutenberg-font-face-resolver-6-4.php ❔ lib/compat/wordpress-6.4/fonts/font-face/class-wp-font-face-resolver.php ❔ lib/compat/wordpress-6.4/fonts/fonts.php ❔ lib/load.php ❔ phpunit/tests/fonts/font-face/wpFontFaceResolver/getFontsFromThemeJson.php |
|
This PR should resolve why the tests are failing in #53273. |
matiasbenedetto
left a comment
There was a problem hiding this comment.
I tried this and the Gutenberg specific font face resolver (Gutenberg_Font_Face_Resolver_6_4) it is loading fine. The code of it is the same as in 6.4 core and all the PHP unit tests are running as expected so I think this is good to go.
I think this PR was initially planned to fix some problems on #53273, probably that PR will be replaced by #56447. I tried #56447 with and without the changes in this PR and it's working the same. Apart from that if we anticipate changes in the resolver that should be in Gutenberg this PR is a good addition so I'm approving.
What?
Adds and uses
Gutenberg_Font_Face_Resolver_6_4.Why?
Font Face is already merged into WordPress Core. Since it loads before the plugin, the plugin's Font Face files do not get loaded into memory. Thus any changes made or needed will not get loaded when WP 6.4 or Core's
trunkis used (such as in the test suite).By having a duplicate of the resolver that is for the plugin only, this new resolver does get loaded into memory and is used when not running WP 6.4 or Core's
trunk. Thus all changes get tested.How?
trunk, it unhooks Core'swp_print_font_facescallback, adds a GB specific callback, invokes the new resolver, and then passes the results towp_print_font_faces().Testing Instructions
All CI jobs should pass.
And the
fontstests should pass when running: