Skip to content

Instantly share code, notes, and snippets.

Created March 6, 2018 14:48
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Modify the available block formats within WordPress' TinyMCE editor. A quick solution for
* Change the block formats available in TinyMCE.
* @link
* @param array $init Default settings to be overridden.
* @return array The modified $init array.
function cdils_change_mce_block_formats( $init ) {
$block_formats = array(
'Heading 1=h1',
'Heading 2=h2',
'Heading 3=h3',
'Heading 4=h4',
'Heading 5=h5',
'Heading 6=h6',
$init['block_formats'] = implode( ';', $block_formats );
return $init;
add_filter( 'tiny_mce_before_init', 'cdils_change_mce_block_formats' );
Copy link

cdils commented Mar 6, 2018


Copy link

Hey Bart, remember this Gist? Well it's blog form!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment