Many of the TinyMCE settings have changed in version 4.0. There is a new default theme: Modern, and all the UI settings for the former Advanced theme (theme_advanced...)
are deprecated.
One often used setting was theme_advanced_blockformats
.
It was renamed to block_formats
and keeps the same formatting. To specify a different set of elements for the ‘blockformats’ drop-down (second toolbar row in the WordPress Visual editor), you can set a string of name=value pairs separated by a semicolon in the initialization object:
block_formats: "Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3"
Another handy setting: theme_advanced_styles
doesn’t exist any more. However there is a more powerful version: style_formats
. Now it can replace or add items to the new “Formats” menu.The value is an array of objects each containing a name that is displayed as sub-menu and several settings: a CSS class name or an inline style, and optionally the wrapper element where the class or inline style will be set:
toolbar3: 'styleselect', style_formats_merge: true, style_formats: { name: 'Custom styles', [ {title: 'Red bold text', inline: 'b', styles: {color: '#ff0000'}}, {title: 'Red text', inline: 'span', styles: {color: '#ff0000'}}, {title: 'Red header', block: 'h1', styles: {color: '#ff0000'}}, {title: 'Example 1', inline: 'span', classes: 'example1'}, {title: 'Example 2', inline: 'span', classes: 'example2'} ]}
The above code will add another sub-menu to “Formats” without replacing the default menu items. There is more information and an example on the TinyMCE website.