From 3588eeb143f0cded831002ef001e88a02e802e99 Mon Sep 17 00:00:00 2001 From: Noah Allen Date: Fri, 6 Sep 2019 14:34:34 -0700 Subject: [PATCH] Use FSE helper function to determine if site has FSE This is much more concise and also centralizes logic around this check into the same function which makes things much easier to reason about --- sal/class.json-api-site-jetpack.php | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/sal/class.json-api-site-jetpack.php b/sal/class.json-api-site-jetpack.php index 445534e373fe..1a10dbe0f9bd 100644 --- a/sal/class.json-api-site-jetpack.php +++ b/sal/class.json-api-site-jetpack.php @@ -201,27 +201,7 @@ function is_fse_active() { if ( ! Jetpack::is_plugin_active( 'full-site-editing/full-site-editing-plugin.php' ) ) { return false; } - if ( - /** - * Allow disabling Full Site Editing, even when the FSE plugin is active. - * - * @module json-api - * - * @since 7.7.0 - * - * @param bool $disable_fse Disable Full Site Editing. Defaults to false. - */ - apply_filters( 'a8c_disable_full_site_editing', false ) - ) { - return false; - } - $has_is_supported_theme_method = method_exists( '\A8C\FSE\Full_Site_Editing', 'is_supported_theme' ); - $has_normalize_theme_slug = method_exists( '\A8C\FSE\Full_Site_Editing', 'normalize_theme_slug' ); - if ( $has_is_supported_theme_method && $has_normalize_theme_slug ) { - $slug = \A8C\FSE\Full_Site_Editing::get_instance()->normalize_theme_slug( get_option( 'stylesheet' ) ); - return \A8C\FSE\Full_Site_Editing::get_instance()->is_supported_theme( $slug ); - } - return false; + return function_exists( '\A8C\FSE\is_full_site_editing_active' ) && \A8C\FSE\is_full_site_editing_active(); } /**