-
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
Font Library: Refactor logic to disable font library in the frontend. #54748
Conversation
…e font library. This change is needed in core because there, we will not be using the PHP constant FONT_LIBRARY_DISABLED. The previous code depended on this constant to render the library in the frontend. With this change the library will render as default.
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/experimental/fonts/font-library/font-library.php ❔ lib/load.php |
Size Change: +5 B (0%) Total Size: 1.62 MB
ℹ️ View Unchanged
|
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.
LGTM!
…#54748) * Refactor logic and naming of the frontend variable used to disable the font library. This change is needed in core because there, we will not be using the PHP constant FONT_LIBRARY_DISABLED. The previous code depended on this constant to render the library in the frontend. With this change the library will render as default. * avoid using a new file just for one call. move the call to load.php
I just cherry-picked this PR to the release/16.7 branch to get it included in the next release: 76893f8 |
What?
Refactor logic to disable font library in the frontend.
Why?
This change is needed in core because we will not be using the PHP constant FONT_LIBRARY_DISABLED. The previous code depended on this constant to render the library in the frontend. With this change, the library will render as default.
How?
Previously we were enabling the library based on a constant that won't be in core. Now is enabled by default and we need to disable it explicitly.
Testing Instructions
Try with these cases in
wp-config.php
:define( 'FONT_LIBRARY_DISABLED', true );
-> Should NOT render the librarydefine( 'FONT_LIBRARY_DISABLED', false );
-> Should render the libraryFONT_LIBRARY_DISABLED constant missing / undefined -> Should render the library.