is_plugin_installed() ) {
$active_step = 'install';
} elseif ( ! $this->is_plugin_active() || ! $this->is_experiment_enabled() ) {
$active_step = 'activate';
}
// Early exit if there's nothing to do.
if ( ! $active_step ) {
return;
}
?>
get_template_directory();
// No need to do anything if the theme we switched to supports Full Site Editing.
// Check if the block-templates folder exists, and if it does then early exit.
if ( file_exists( $new_theme_path . '/block-templates' ) || is_dir( $new_theme_path . '/block-templates' ) ) {
return;
}
// Get option.
$option = get_option( 'gutenberg-experiments', [] );
// Sanity check for option.
if ( ! is_array( $option ) ) {
$option = [];
}
// Disable experiment.
unset( $option['gutenberg-full-site-editing'] );
// Update the option.
update_option( 'gutenberg-experiments', $option );
}
}
}
if ( ! function_exists( 'wpthemes_require_gutenberg_fse' ) ) {
/**
* Load the Gutenberg requirement.
*
* @return void
*/
function wpthemes_require_gutenberg_fse() {
// Instantiate the object.
$init = new WPThemes_Require_Gutenberg();
// Run our actions.
$init->run();
}
}
// Run Gutenberg requirement.
wpthemes_require_gutenberg_fse();