-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Backport theme.json version 3 migrations #6616
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
Changes from 1 commit
668c31e
4c02184
a4e24a0
4696b35
97a24e0
719a4bd
9a0e4b4
915f254
2f9b431
3769e79
dc57d38
943d9bb
0a33eb1
35695f2
7599a7f
ca161da
caaeb72
6569a11
d073251
93e3c82
ea23bf0
afe235e
1b583a1
1e93db4
c8cdcc1
5214e4f
6b6d2b6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -310,6 +310,19 @@ public static function get_theme_data( $deprecated = array(), $options = array() | |
| } | ||
| $theme_support_data['settings']['color']['defaultGradients'] = $default_gradients; | ||
|
|
||
| if ( ! isset( $theme_support_data['settings']['typography'] ) ) { | ||
| $theme_support_data['settings']['typography'] = array(); | ||
| } | ||
| $default_font_sizes = false; | ||
| if ( current_theme_supports( 'default-font-sizes' ) ) { | ||
| $default_font_sizes = true; | ||
| } | ||
| if ( ! isset( $theme_support_data['settings']['typography']['fontSizes'] ) ) { | ||
| // If the theme does not have any font sizes, we still want to show the core one. | ||
| $default_font_sizes = true; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I haven't tested, but optional for follow up, these conditions return bools so the return value can be used to set the var, e.g.,
Not really required though, just filling space here... 😄
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The whole thing could use a refactor. I chose to use the same structure as colors, gradients, and shadows above and below this for now to be clear that it was doing exactly the same thing as those other settings. https://github.com/WordPress/wordpress-develop/pull/6616/files#diff-d6b86476eed058e7cf8b6e57fa52c4fd75b1f0907e1a9ccb0149528a24f7578bR294-R302 |
||
| } | ||
| $theme_support_data['settings']['typography']['defaultFontSizes'] = $default_font_sizes; | ||
|
|
||
| if ( ! isset( $theme_support_data['settings']['shadow'] ) ) { | ||
| $theme_support_data['settings']['shadow'] = array(); | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.