Closed
Description
What is the easiest way to detect if the current edit screen is using Gutenberg in both PHP and JS.
For example, in PHP:
add_action('init', 'my_init');
function my_init() {
// Detect if is Gutenberg.
if( is_gutenberg_editor_active() ) {
// Do something.
} else {
// Do something else.
}
}
And in JS:
$(document).ready(function(){
// Detect if is Gutenberg.
if( wp.isGutenbergActive() ) {
// Do something.
} else {
// Do something else.
}
});
Thanks
Elliot