Skip to content

Commit

Permalink
Check for Full Site Editing on Jetpack sites
Browse files Browse the repository at this point in the history
* check if FSE is active
* also check if the theme is supported
  • Loading branch information
mattwiebe authored and jeherve committed Aug 26, 2019
1 parent 214e70f commit dee3063
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions sal/class.json-api-site-jetpack.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,17 @@ function current_user_can( $role ) {
return current_user_can( $role );
}

function is_fse_active() {
$fse_enabled = is_plugin_active( 'full-site-editing/full-site-editing-plugin.php' );
$has_method = method_exists( '\A8C\FSE\Full_Site_Editing', 'is_supported_theme' );
if ( $fse_enabled && $has_method ) {
$fse = \A8C\FSE\Full_Site_Editing::get_instance();
$slug = get_option( 'stylesheet' );
return $fse->is_supported_theme( $slug );
}
return false;
}

/**
* Post functions
*/
Expand Down

0 comments on commit dee3063

Please sign in to comment.