Editor-style.css does not upload to server [solved]

Wordpress issue: editor-style.css does not upload to server: solved

During WordPress development process my editor-style.css didn’t want to update on server side because of some cashing. But fixing this is simple. You only need to add new suffix on “tiny_mce_before_init” hook and everything will be OK.

The TinyMCE init array has a [cache_suffix](https://www.tinymce.com/docs/configure/integration-and-setup/#cache_suffix) set to `’wp-mce-‘ . $tinymce_version`.

So instead, you can just overwrite that with the [tiny_mce_before_init](https://developer.wordpress.org/reference/hooks/tiny_mce_before_init/) filter or concatenate a new verstion which is a string.

function 1234_tiny_mce_before_init( $mce_init ) {

$mce_init[‘cache_suffix’] .= ‘v=’ . filemtime(get_template_directory_uri() . ‘editor-style.css’);

return $mce_init;
}
add_filter( ‘tiny_mce_before_init’, ‘1234_tiny_mce_before_init’ );

 

Tagged :

Leave a Reply

Your email address will not be published. Required fields are marked *