From f73fb3c4320143b982182d0b1636117999985df0 Mon Sep 17 00:00:00 2001 From: tellthemachines Date: Mon, 9 Dec 2024 10:47:35 +1100 Subject: [PATCH 1/3] Update global stylesheet docblocks with `custom-css` parameter. --- lib/class-wp-theme-json-gutenberg.php | 2 ++ lib/global-styles-and-settings.php | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/class-wp-theme-json-gutenberg.php b/lib/class-wp-theme-json-gutenberg.php index 083ce3516b71a..778dcdbec78d9 100644 --- a/lib/class-wp-theme-json-gutenberg.php +++ b/lib/class-wp-theme-json-gutenberg.php @@ -1319,6 +1319,8 @@ public function get_settings() { * - `variables`: only the CSS Custom Properties for presets & custom ones. * - `styles`: only the styles section in theme.json. * - `presets`: only the classes for the presets. + * - `base-layout-styles`: only the base layout styles. + * - `custom-css`: only the custom CSS. * @param array $origins A list of origins to include. By default it includes VALID_ORIGINS. * @param array $options An array of options for now used for internal purposes only (may change without notice). * The options currently supported are: diff --git a/lib/global-styles-and-settings.php b/lib/global-styles-and-settings.php index c4446cf29cf01..f05e9dac50b75 100644 --- a/lib/global-styles-and-settings.php +++ b/lib/global-styles-and-settings.php @@ -9,7 +9,7 @@ * Returns the stylesheet resulting of merging core, theme, and user data. * * @param array $types Types of styles to load. Optional. - * It accepts as values: 'variables', 'presets', 'styles', 'base-layout-styles. + * It accepts as values: 'variables', 'presets', 'styles', 'base-layout-styles, 'custom-css'. * If empty, it'll load the following: * - for themes without theme.json: 'variables', 'presets', 'base-layout-styles'. * - for themes with theme.json: 'variables', 'presets', 'styles'. From ee0734ce68e01e0b1cd75455fed5d447cafb9e83 Mon Sep 17 00:00:00 2001 From: tellthemachines Date: Mon, 9 Dec 2024 10:54:37 +1100 Subject: [PATCH 2/3] backport changelog --- backport-changelog/6.8/7976.md | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 backport-changelog/6.8/7976.md diff --git a/backport-changelog/6.8/7976.md b/backport-changelog/6.8/7976.md new file mode 100644 index 0000000000000..e2942d5e4fbe1 --- /dev/null +++ b/backport-changelog/6.8/7976.md @@ -0,0 +1,3 @@ +https://github.com/WordPress/wordpress-develop/pull/7976 + +* https://github.com/WordPress/gutenberg/pull/67716 \ No newline at end of file From f038d937ae853f4e26e11ad4ba3986c627d1df10 Mon Sep 17 00:00:00 2001 From: tellthemachines Date: Mon, 9 Dec 2024 11:37:21 +1100 Subject: [PATCH 3/3] Additional context. --- lib/global-styles-and-settings.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/global-styles-and-settings.php b/lib/global-styles-and-settings.php index f05e9dac50b75..3ff5e6cb135e1 100644 --- a/lib/global-styles-and-settings.php +++ b/lib/global-styles-and-settings.php @@ -9,7 +9,7 @@ * Returns the stylesheet resulting of merging core, theme, and user data. * * @param array $types Types of styles to load. Optional. - * It accepts as values: 'variables', 'presets', 'styles', 'base-layout-styles, 'custom-css'. + * See {@see 'WP_Theme_JSON::get_stylesheet'} for all valid types. * If empty, it'll load the following: * - for themes without theme.json: 'variables', 'presets', 'base-layout-styles'. * - for themes with theme.json: 'variables', 'presets', 'styles'. @@ -142,6 +142,8 @@ function gutenberg_get_global_settings( $path = array(), $context = array() ) { /** * Gets the global styles custom css from theme.json. * + * @deprecated Gutenberg 18.6.0 Use {@see 'gutenberg_get_global_stylesheet'} instead for top-level custom CSS, or {@see 'WP_Theme_JSON_Gutenberg::get_styles_for_block'} for block-level custom CSS. + * * @return string */ function gutenberg_get_global_styles_custom_css() {