Skip to content
This repository was archived by the owner on Feb 17, 2025. It is now read-only.

Blockbase: Remove style variations#7001

Closed
mmtr wants to merge 1 commit into
trunkfrom
remove/blockbase-style-variations
Closed

Blockbase: Remove style variations#7001
mmtr wants to merge 1 commit into
trunkfrom
remove/blockbase-style-variations

Conversation

@mmtr

@mmtr mmtr commented Apr 10, 2023

Copy link
Copy Markdown
Member

Changes proposed in this Pull Request:

As of Gutenberg 15.1/WordPress 6.2, child themes inherit the style variations of the parent theme.

This is causing issues to Blockbase child themes such as Jackson in WordPress.com, because the headstart content for a child theme is only created for the default style variation. When a different style variation is applied, the styles from the headstart content are incompatible with the new variation:

Screen.Recording.2023-04-06.at.15.51.17.mov

To mitigate that, and following this suggestion from @pbking, this PR removes the style variations from the Blockbase theme, so users are no longer able to select them for either the parent or any child theme.

This is an alternate approach of #6996 / D107265-code, which only removes the variations for Blockbase child themes and keeps them on the parent theme.

Testing instructions:

  • Apply these changes to your WP.com sandbox: npm run deploy:push:changes
  • Also apply these changes to your sandbox to avoid issues with the themes cache while testing:
diff --git a/wp-content/lib/wpcom-themes.php b/wp-content/lib/wpcom-themes.php
index 534de104e0..7a2e46d7d9 100644
--- a/wp-content/lib/wpcom-themes.php
+++ b/wp-content/lib/wpcom-themes.php
@@ -2099,7 +2099,8 @@ class WPCom_Themes {
        }
 
        public static function get_style_variations( $stylesheet ) {
-               $style_variations = wp_cache_get( "style_variations_$stylesheet", 'themes' );
+               //$style_variations = wp_cache_get( "style_variations_$stylesheet", 'themes' );
+               $style_variations = false;
 
                if ( $style_variations === false ) {
                        $theme_demo_site = wpcom_get_theme_demo_site( $stylesheet );
@@ -2156,7 +2157,7 @@ class WPCom_Themes {
                                $style_variation['slug'] = sanitize_title( $style_variation['title'] );
                        }
 
-                       wp_cache_set( "style_variations_$stylesheet", $style_variations, 'themes', 5 * MINUTE_IN_SECONDS );
+                       //wp_cache_set( "style_variations_$stylesheet", $style_variations, 'themes', 5 * MINUTE_IN_SECONDS );
                }
 
                return $style_variations;
  • Sandbox the API
  • It's also recommended to use an incognito window/private session to avoid issues with the cached API responses by Calypso.
  • Go to the WP.com Design Picker (wordpress.com/setup/site-setup/designSetup?siteSlug=<SITE_DOMAIN>)
  • Search a Blockbase child theme such as Jackson
  • Make sure it does not have any style variation
  • Go to WP.com > Appearance > Themes
  • Search a Blockbase child theme such as Jackson
  • Make sure it does not have any style variation
  • Activate it
  • Go to WP.com > Appearance > Editor
  • Open the Styles sidebar
  • Make sure it does not have any style variation

Related issue(s):

Fixes #6941.

@BogdanUngureanu

Copy link
Copy Markdown
Contributor

Works as expected for free themes. However, for Skivers, I've noticed that the style variations still appear. I think this is because premium themes have a blockbase-premium theme.

@pbking

pbking commented Apr 10, 2023

Copy link
Copy Markdown
Contributor

Should we migrate some of these removed style variations to those child themes that they DID work in? It doesn't just remove the variations that don't work, it also removes many that do.

@pbking

pbking commented Apr 10, 2023

Copy link
Copy Markdown
Contributor

It seems that the problem is specific to a particular pattern. Rather than removing all of the potentially valuable variations we instead fix the pattern in question.

See this comment for more details.

@mmtr

mmtr commented Apr 13, 2023

Copy link
Copy Markdown
Member Author

Abandoning this in favor of #6996.

@mmtr mmtr closed this Apr 13, 2023
@mmtr mmtr deleted the remove/blockbase-style-variations branch April 13, 2023 14:47
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Blockbase child themes & incompatible style variations

3 participants