-
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
Add default-spacing-sizes
and default-font-sizes
options for classic themes
#62252
Merged
Merged
Changes from 7 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
b13df0d
Add default-font-sizes options for classic themes
ajlende 2f32da9
Add default-spacing-sizes options for classic themes
ajlende 937ecca
Add backport changelog
ajlende d97af0e
Backport get_classic_theme_supports_block_editor_settings from core
ajlende a0ded7a
Add doc comment for get_theme_data new theme supports
ajlende 05d7d2a
Add editor-spacing-sizes option for classic themes
ajlende 93e3a09
Update types
ajlende 3a0a273
Load block-editor in the right place
ajlende 7d63e29
Copy spacingSizes from editor-spacing-sizes
ajlende 58e3108
Add editor-spacing-sizes to docs
ajlende 2dcd295
Fix editor-spacing-sizes docs
ajlende 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
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?php | ||
/** | ||
* Block Editor API. | ||
* | ||
* @package Gutenberg | ||
* @subpackage Editor | ||
*/ | ||
|
||
/** | ||
* Returns the classic theme supports settings for block editor. | ||
* | ||
* @since 6.2.0 | ||
* @since 6.6.0 Add support for custom spacing sizes. | ||
* | ||
* @return array The classic theme supports settings. | ||
*/ | ||
function gutenberg_get_classic_theme_supports_block_editor_settings() { | ||
$theme_settings = array( | ||
'disableCustomColors' => get_theme_support( 'disable-custom-colors' ), | ||
'disableCustomFontSizes' => get_theme_support( 'disable-custom-font-sizes' ), | ||
'disableCustomGradients' => get_theme_support( 'disable-custom-gradients' ), | ||
'disableLayoutStyles' => get_theme_support( 'disable-layout-styles' ), | ||
'enableCustomLineHeight' => get_theme_support( 'custom-line-height' ), | ||
'enableCustomSpacing' => get_theme_support( 'custom-spacing' ), | ||
'enableCustomUnits' => get_theme_support( 'custom-units' ), | ||
); | ||
|
||
// Theme settings. | ||
$color_palette = current( (array) get_theme_support( 'editor-color-palette' ) ); | ||
if ( false !== $color_palette ) { | ||
$theme_settings['colors'] = $color_palette; | ||
} | ||
|
||
$font_sizes = current( (array) get_theme_support( 'editor-font-sizes' ) ); | ||
if ( false !== $font_sizes ) { | ||
$theme_settings['fontSizes'] = $font_sizes; | ||
} | ||
|
||
$gradient_presets = current( (array) get_theme_support( 'editor-gradient-presets' ) ); | ||
if ( false !== $gradient_presets ) { | ||
$theme_settings['gradients'] = $gradient_presets; | ||
} | ||
|
||
$spacing_sizes = current( (array) get_theme_support( 'editor-spacing-sizes' ) ); | ||
if ( false !== $spacing_sizes ) { | ||
$theme_settings['spacingSizes'] = $spacing_sizes; | ||
} | ||
|
||
return $theme_settings; | ||
} |
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
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.
Copied from core. See https://github.com/WordPress/wordpress-develop/pull/6616/files#diff-edfc853e670c7bfc5a838dc74f75ba5d8b95cb4adbddf0644d9227bcb692e344 for a better diff.