Last active
May 12, 2016 09:17
-
-
Save jasonkiss/a5a15200c0591f2c7b6508bf63e23be2 to your computer and use it in GitHub Desktop.
Remove empty <p> from WordPress content. Prevent TinyMCE in Wordpress from wrapping non-block elements or text nodes in <p> tags or injecting empty paragraphs. Fixes the problem where moving from the textual to the visual editor causes unwanted <p> </p> to be added. See https://www.tinymce.com/docs/configure/content-filtering/#forced_root_b…
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 override_mce_options($in) { | |
$in['forced_root_block'] = false; | |
return $in; | |
} | |
add_filter('tiny_mce_before_init', 'override_mce_options'); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment