Font Library: Refactor logic to disable font library in the frontend.#54748
Merged
matiasbenedetto merged 2 commits intotrunkfrom Sep 24, 2023
Merged
Font Library: Refactor logic to disable font library in the frontend.#54748matiasbenedetto merged 2 commits intotrunkfrom
matiasbenedetto merged 2 commits intotrunkfrom
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
|
mikachan
approved these changes
Sep 23, 2023
mikachan
pushed a commit
that referenced
this pull request
Sep 25, 2023
…#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
Member
|
I just cherry-picked this PR to the release/16.7 branch to get it included in the next release: 76893f8 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.