Last active
June 12, 2018 19:24
-
-
Save dartiss/028c0065c06b0b84a26f40038fbf47b7 to your computer and use it in GitHub Desktop.
Detect Gutenberg use
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 is_gutenberg() { | |
global $post; | |
if ( function_exists( 'gutenberg_post_has_blocks' ) && gutenberg_post_has_blocks( $post->ID ) { | |
return true; | |
} else { | |
return false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment