Skip to content

Commit

Permalink
Theme: Treat the block-based theme as a FSE theme
Browse files Browse the repository at this point in the history
  • Loading branch information
arthur791004 committed Oct 22, 2024
1 parent c27426f commit 2b845f2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions client/my-sites/themes/is-full-site-editing-theme.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import { Theme } from 'calypso/types';

export function isFullSiteEditingTheme( theme: Theme | null ): boolean {
if ( theme?.block_theme ) {
return true;
}

const features = theme?.taxonomies?.theme_feature;
return features?.some( ( feature ) => feature.slug === 'full-site-editing' ) ?? false;
}
4 changes: 4 additions & 0 deletions client/state/themes/selectors/is-full-site-editing-theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ export function isFullSiteEditingTheme(
return false;
}

if ( theme.block_theme ) {
return true;
}

const themeFeatures = getThemeTaxonomySlugs( theme, 'theme_feature' );

return themeFeatures.includes( 'full-site-editing' );
Expand Down
1 change: 1 addition & 0 deletions client/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export interface Theme {
author: string;
author_uri: string;
cost: ThemeCost;
block_theme?: boolean;
date_launched: string;
date_updated: string;
demo_uri?: string;
Expand Down

0 comments on commit 2b845f2

Please sign in to comment.