Created
October 18, 2019 06:57
-
-
Save TeemuSuoranta/16accb52a24f1f4dd0d22df701047d76 to your computer and use it in GitHub Desktop.
Revisions
-
TeemuSuoranta created this gist
Oct 18, 2019 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ <?php /** * Remove empty paragraphs * * @param string $content the HTML markup of content * * @return string the HTML markup of content */ add_filter('the_content', function ($content) { if (!is_admin()) { $content = str_replace('<p></p>', '', $content); $content = str_replace('<p> </p>', '', $content); } return $content; });