Skip to content
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

FSE: Add a filter to determine whether a theme should use the Site Editor #31235

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/full-site-editing/full-site-editing.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
* @return boolean Whether the current theme is an FSE theme or not.
*/
function gutenberg_is_fse_theme() {
Copy link
Member

@vindl vindl May 5, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe some confusion is stemming from the fact that we are using this function to gate FSE features/functionality in different places. Would gutenberg_is_fse_active with a filterable return be a more appropriate name? It could even wrap the existing gutenberg_is_fse_theme function, theme support checks, and in general allow for more complicated checks in the future if needed.

return is_readable( get_stylesheet_directory() . '/block-templates/index.html' );
$is_fse_theme = is_readable( get_stylesheet_directory() . '/block-templates/index.html' );
return apply_filters( 'gutenberg_is_fse_theme', $is_fse_theme );
}

/**
Expand Down