-
Notifications
You must be signed in to change notification settings - Fork 843
Add new i18n fonts and rename them via filter #27854
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
95be808
[not verified] Filter wp_theme_json_data_theme to alter font names
simison 77260de
[not verified] changelog
simison ea4c1ec
[not verified] Translate font names and move fonts to a getter
simison 320f9e4
[not verified] Simplify lists and renaming
simison 2271d22
[not verified] Add back filter docblock
simison 8b243cf
[not verified] Tweak docblock to remove change
simison 3aa548e
[not verified] Remove default filter priority & attribute count
simison af4ccca
[not verified] Be more defensive about when renaming
simison 366c75e
[not verified] Wrap in the admin/api check
simison f909bbc
[not verified] Simplify early bailout
simison 6ca77fd
[not verified] Switch translations to use sprintf
simison 22eb6c6
Merge remote-tracking branch 'origin/trunk' into update/fonts-i18n-fi…
jeherve File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[not verified] Be more defensive about when renaming
- Loading branch information
commit af4ccca95406d88928f3358e19b253da94b3c963
There are no files selected for viewing
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
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.
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.
Do all block themes have all of these keys defined? If not it might make sense to return early if an
isset()returns false.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.
Will
JETPACK_GOOGLE_FONTS_LISTbe part of$font_families? Or is$font_familiesthe static representation of that theme json data?Uh oh!
There was an error while loading. Please reload this page.
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.
They are always defined because before this filter we registered the fonts, and they end up to
themestyle object when registered with withwp_register_webfonts()— even from a plugin. A bit confusing. :-)That said, something that could in theory happen is that all Jetpack fonts or typography settings get filtered out or shortcirquitted by some plugin or theme. The shape of the data could also change later on in Gutenberg.
$theme_json->update_with()takes care of versioning later on but here we don't have that safeguard. I'll add a check!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.
I added a few checks;