Skip to content

Commit

Permalink
Editor: Update docblocks for wp_get_global_stylesheet and `WP_Theme…
Browse files Browse the repository at this point in the history
…_JSON::get_stylesheet`.

Updates docblocks to account for new use of the `custom-css` string in their `$types` parameters and adds information to deprecation of `wp_get_global_styles_custom_css`.

Props justlevine, isabel_brison, ramonopoly.
Fixes #62665.


git-svn-id: https://develop.svn.wordpress.org/trunk@59499 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
tellthemachines committed Dec 9, 2024
1 parent faff3a2 commit a1079b6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/wp-includes/class-wp-theme-json.php
Original file line number Diff line number Diff line change
Expand Up @@ -1317,6 +1317,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 string[] $origins A list of origins to include. By default it includes VALID_ORIGINS.
* @param array $options {
* Optional. An array of options for now used for internal purposes only (may change without notice).
Expand Down
2 changes: 1 addition & 1 deletion src/wp-includes/deprecated.php
Original file line number Diff line number Diff line change
Expand Up @@ -6316,7 +6316,7 @@ function wp_interactivity_process_directives_of_interactive_blocks( array $parse
* Gets the global styles custom CSS from theme.json.
*
* @since 6.2.0
* @deprecated 6.7.0 Use {@see 'wp_get_global_stylesheet'} instead.
* @deprecated 6.7.0 Use {@see 'wp_get_global_stylesheet'} instead for top-level custom CSS, or {@see 'WP_Theme_JSON::get_styles_for_block'} for block-level custom CSS.
*
* @return string The global styles custom CSS.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/wp-includes/global-styles-and-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ function wp_get_global_styles( $path = array(), $context = array() ) {
* @since 6.6.0 Resolves relative paths in theme.json styles to theme absolute paths.
*
* @param array $types Optional. Types of styles to load.
* It accepts as values 'variables', 'presets', 'styles', 'base-layout-styles'.
* 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'.
Expand Down

0 comments on commit a1079b6

Please sign in to comment.