Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am jasonkiss on github.
  • I am jasonkiss (https://keybase.io/jasonkiss) on keybase.
  • I have a public key whose fingerprint is 775F 2D7D FCCC 6155 1324 923E 5D2A 1067 4BBE C0B2

To claim this, I am signing this object:

@jasonkiss
jasonkiss / override_mce_options.php
Last active May 12, 2016 09:17
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>&nbsp;</p> to be added. See https://www.tinymce.com/docs/configure/content-filtering/#forced_root_b…
<?php
function override_mce_options($in) {
$in['forced_root_block'] = false;
return $in;
}
add_filter('tiny_mce_before_init', 'override_mce_options');
?>