add_editor_style is not working

I've reviewed various blog posts, stackexchange topics, etc, but can find no way to get add_editor_style() to work in WordPress 4.1.5.

Is anyone having any luck getting this function to work in recent versions of WordPress? Can I see how you've done it?

Currently I have something like the following in my functions.php file:

add_action( 'init', 'my_theme_add_editor_styles' );
function my_theme_add_editor_styles() {
  add_editor_style('editor-style.css');
}

I see my editor-style.css referenced in the tinyMCEPreInit settings in the head (among the stylesheets assigned to 'content_css'), but there is otherwise no reference to editor-style.css in the head of the document.

PS -- The following also does not work:

function my_theme_add_editor_styles() {
  add_editor_style('editor-style.css');
}
add_action('admin_init', 'my_theme_add_editor_styles' );

Topic add-editor-style Wordpress

Category Web


I've now realized the code I posted works. I expected to see the stylesheet referenced in the head, but there is no such reference. It turns out the styles are being applied solely on the basis of the settings in tinyMCEPreInit.

In fact, this is all that's needed:

add_editor_style('editor-style.css');

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.