Skip to content

Commit

Permalink
Fix default presets and clean-up
Browse files Browse the repository at this point in the history
  • Loading branch information
oandregal committed Dec 17, 2021
1 parent 2329984 commit 81ae91e
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions lib/compat/wordpress-5.9/get-global-styles-and-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,9 @@ function wp_get_global_stylesheet( $types = array() ) {
}

/**
* Returns the stylesheet resulting of merging core, theme, and user data.
* Returns a string containing the SVGs to be referenced as filters (duotone).
*
* @return string Stylesheet.
* @return string
*/
function wp_get_global_styles_svg_filters() {
// Return cached value if it can be used and exists.
Expand All @@ -156,17 +156,10 @@ function wp_get_global_styles_svg_filters() {
}

$supports_theme_json = WP_Theme_JSON_Resolver_Gutenberg::theme_has_support();
$supports_link_color = get_theme_support( 'experimental-link-color' );

// TODO: Which origins are needed for duotone filters?
$origins = array( 'core', 'theme', 'user' );
if ( ! $supports_theme_json && ! $supports_link_color ) {
// In this case we only enqueue the core presets (CSS Custom Properties + the classes).
$origins = array( 'core' );
} elseif ( ! $supports_theme_json && $supports_link_color ) {
// For the legacy link color feature to work, the CSS Custom Properties
// should be in scope (either the core or the theme ones).
$origins = array( 'core', 'theme' );

$origins = array( 'default', 'theme' );
if ( ! $supports_theme_json ) {
$origins = array( 'default' );
}

$tree = WP_Theme_JSON_Resolver_Gutenberg::get_merged_data();
Expand Down

0 comments on commit 81ae91e

Please sign in to comment.