Created
January 25, 2019 09:09
-
-
Save jonschr/849c307e09b50aeaa260ece42e2d14f5 to your computer and use it in GitHub Desktop.
Remove the wpautop filter
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
/** | |
* Remove the wpautop filter from the_content | |
*/ | |
remove_filter( 'the_content', 'wpautop' ); | |
add_filter( 'the_content', function ($content) { | |
if (has_blocks()) { | |
return $content; | |
} | |
return wpautop($content); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment