I've added the styles dropdown list to my TinyMCE editor in Wordpress. If I select the style, and preview it on the front end, it looks exactly like I expect it to. However, I'd like to preview it in the editor as well.
By adding my '.blue-button' class to /wp-includes/js/tinymce/themes/advanced/skins/wp_theme/content.css, I was able to preview it like I want to, but this seems hackish and will probably break upon a TinyMCE update. Is there a filter to do this?
So far I have the following:
add_filter('tiny_mce_before_init', 'customizeWYSIWYGToolbar' );
function customizeWYSIWYGToolbar($init) {
$init['theme_advanced_buttons2_add_before'] = 'styleselect'; // Adds the buttons at the begining. (theme_advanced_buttons2_add adds them at the end)
$init['theme_advanced_styles'] = 'Blue Button=blue-button';
$init['theme_advanced_disable'] = 'underline, justifyfull, charmap, pasteword';
return $init;
}
add_filter( 'mce_css', 'tdav_css' );
add_editor_style('css/admin.css');
add_action('init', 'WYSIWYGCSS');
function WYSIWYGCSS(){
wp_enqueue_style( 'wysiwygStyles', get_bloginfo('stylesheet_directory').'/css/admin.css', ",",'all' );
}
Thanks!