Editor: Introduce spacing presets in global style properties.

This changeset is part of the Gutenberg changes merged into WP 6.1. It adds spacing presets support in global style properties.

Follow-up to [54211].

Props glendaviesnz, andrewserong, costdev, audrasjb, mukesh27.
See #56467.


git-svn-id: https://develop.svn.wordpress.org/trunk@54272 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Jb Audras
2022-09-21 11:41:44 +00:00
parent 6c6a6747a0
commit 30de259b07
5 changed files with 543 additions and 6 deletions

View File

@@ -470,7 +470,7 @@ class WP_Theme_JSON_Resolver {
* @since 5.8.0
* @since 5.9.0 Added user data, removed the `$settings` parameter,
* added the `$origin` parameter.
* @since 6.1.0 Added block data.
* @since 6.1.0 Added block data and generation of spacingSizes array.
*
* @param string $origin Optional. To what level should we merge data.
* Valid values are 'theme' or 'custom'. Default 'custom'.
@@ -490,6 +490,9 @@ class WP_Theme_JSON_Resolver {
$result->merge( static::get_user_data() );
}
// Generate the default spacingSizes array based on the merged spacingScale settings.
$result->set_spacing_sizes();
return $result;
}