-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
wp_get_global_styles
: for custom props, it should return the CSS format not the shortened internal one
#49693
Labels
Global Styles
Anything related to the broader Global Styles efforts, including Styles Engine and theme.json
[Type] Bug
An existing feature does not function as intended
Comments
wp_get_global_styles
returns internal formatwp_get_global_styles
: for custom props, it should return the CSS format not the shortened internal one
Plugins need to be aware of this format, when they shouldn't: |
This was referenced Apr 11, 2023
One option to fix this is by making the conversion part of WP_Theme_JSON::sanitize method, so any code dealing with the internal representation of a |
oandregal
pushed a commit
that referenced
this issue
May 10, 2023
Co-authored-by: André <583546+oandregal@users.noreply.github.com> This PR addresses #49693 so the return value for `wp_get_global_styles` given the following theme.json dataset ``` "core/post-terms": { "typography": { "fontSize": "var(--wp--preset--font-size--small)" }, "color":{ "background": "var:preset|color|secondary" } } ``` is: ``` ( [typography] => Array( [fontSize] => var(--wp--preset--font-size--small) ) [color] => Array( [background] => var(--wp--preset--color--secondary) ) ) ```
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Global Styles
Anything related to the broader Global Styles efforts, including Styles Engine and theme.json
[Type] Bug
An existing feature does not function as intended
Related #45171
Description
The
wp_get_global_styles
functions returns an internal format for CSS Custom Properties instead of the proper CSS format.Step-by-step reproduction instructions
theme.json
.styles.blocks
:wp_get_global_styles
functions to retrieve those styles. For example, paste the following infunctions.php
of the theme:The result will be:
when it should have been
Note the
color.background
value. It should return the value in a valid CSS value, not the shortened internal format.The text was updated successfully, but these errors were encountered: