Skip to content

Instantly share code, notes, and snippets.

@certainlyakey
Created March 16, 2018 09:26
Show Gist options
  • Save certainlyakey/e670a436e2d7d43d04a4f129c46c91af to your computer and use it in GitHub Desktop.
Save certainlyakey/e670a436e2d7d43d04a4f129c46c91af to your computer and use it in GitHub Desktop.
Remove formats (text styles) TinyMCE editor (Wordpress)
<?php
// Modify TinyMCE editor to remove H1 and add some other options
function tiny_mce_remove_unused_formats_formatselect($init) {
$init['block_formats'] = 'Paragraph=p;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6';
return $init;
}
add_filter('tiny_mce_before_init', 'tiny_mce_remove_unused_formats_formatselect' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment