Created
August 18, 2020 11:49
-
-
Save jeffreyvr/b5c3f5dfaa262e6fd14bb70a3766cdf9 to your computer and use it in GitHub Desktop.
Is Gutenberg active
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function prefix_is_gutenberg_active() { | |
include_once ABSPATH . 'wp-admin/includes/plugin.php'; | |
$is_gutenberg = has_filter( 'replace_editor', 'gutenberg_init' ) || version_compare( $GLOBALS['wp_version'], '5.0-beta', '>' ); | |
$is_classic_editor = is_plugin_active( 'classic-editor/classic-editor.php' ) && get_option( 'classic-editor-replace' ) === 'no-replace'; | |
if ( $is_gutenberg && ! $is_classic_editor ) { | |
return true; | |
} | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment