TinyMCE format dropdown no longer showing style previews

Ok, this was driving me nuts too as it seems to be completely undocumented However, fear not for it is surprisingly easy to fix! 😀

In your tiny_mce_before_init hook function right before the return statement simply add the line:

unset($init['preview_styles']);

This will make wordpress function as it did before the 3.6 update (the updated added a line in wp-includes/class-wp-editor.php [#347] which changed the default behavior.)

From what I can tell, this setting limits the css properties that will be previewed in the styles drop-down menu. As of 3.6 it is set to 'font-family font-weight text-decoration text-transform' by default. Thus causing properties like: color, size, line-height, etc. to not render.

So if you don’t just let everything slip trough you can also just add some specific properties to the list of allowed properties:

$init['preview_styles'] .= ' background-color color';

I know it’s a bit late, but hopefully this will help in the future since, as of 3.6.1, this is still the default behavior.

Leave a Comment