[wp-trac] [WordPress Trac] #56812: `wp_get_global_settings` returns default color.palette.theme colors with style variation applied in Version 6.1-RC1-54506

WordPress Trac noreply at wordpress.org
Thu Oct 13 02:35:15 UTC 2022


#56812: `wp_get_global_settings` returns default color.palette.theme colors with
style variation applied in Version 6.1-RC1-54506
----------------------------+-----------------------------
 Reporter:  dufresnesteven  |      Owner:  (none)
     Type:  defect (bug)    |     Status:  new
 Priority:  normal          |  Milestone:  Awaiting Review
Component:  General         |    Version:
 Severity:  normal          |   Keywords:
  Focuses:                  |
----------------------------+-----------------------------
 On wp.org, we are launching a feature that allows us to show style
 variations for themes. We built the style variation card (similar to the
 <StylePreview /> in the site editor) by retrieving the global styles
 palette via:

 {{{
 $global_settings = wp_get_global_settings();
 $palette         = $global_settings['color']['palette']['theme'];
 }}}

 Up to and including `Version 6.1-beta3-54468` the `theme` array was
 returning the applied style variations styles (if a style variation was
 applied).

 In `Version 6.1-RC1-54506 ` the `theme` array contains the default colors
 **regardless** of whether a style variation is applied.

 Now the enviroment in which this is running in is somewhat unique (wp-
 themes.com), but the fact that the change happened between `beta3` and
 `RC1` makes this feel unintentional.

 Does anyone have any leads as to why this could be the case? Additionally,
 if there is a better way to retrieve that information, I am more than
 happy to make the change.

 Thanks.


 Example of the style variation cards:
 https://wordpress.org/themes/twentytwentytwo/?beta=style_variations

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/56812>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list