Closed WillMuijrers closed 9 years ago
The only hook that less has into the editor is the mce_css filter (https://github.com/oncletom/wp-less/blob/master/lib/Plugin.class.php#L287). Are you adding a '.less' stylesheet to the editor? If so, if there are errors in the less file, the html output might be ending at the editor.
The Firefox error is not relevant. The other errors indicate that core Wordpress files are not accessible. Can you see the css files if you paste those urls into your browser?
I figured out that this line doesn't seem to work nice when using regular localhost settings on MAMP:
$style_sheet = $parts['scheme'] . '://' . $parts['host'] . $parts['path'];
This is a quick fix for my problem:
$style_sheet = $parts['scheme'] . '://' . $parts['host'] . ':8888' . $parts['path'];
Not a big deal for development, I'll remove the "8888" addition in production.
This could do the trick:
$style_sheet = $parts['scheme'] . '://' . $parts['host'] . (!$parts['port'] ?: ':' . $parts['port']) . $parts['path'];
Worked great, thank you great Oncletom!
FYI - I just adjusted that new code a bit as it was breaking for sites on default ports (80,443). See be3fffedd1c0eba35642407d228a9976c7b08d5f
I don't know why or how. But using the latest version 1.8 of LESS with Wordpress 4.3.1 breaks all the tinyMCE editors in Wordpress. TinyMCE is unable to add styling.
Working locally using MAMP, im getting the following errors in Chrome:
http://localhost/XX/wp-includes/css/dashicons.min.css?wp-mce-4205-20150910 Failed to load resource: net::ERR_CONNECTION_REFUSED
http://localhost/XX/wp-includes/js/tinymce/skins/wordpress/wp-content.css?wp-mce-4205-20150910 Failed to load resource: net::ERR_CONNECTION_REFUSED
in Firefox:
Use of Mutation Events is deprecated. Use MutationObserver instead.
It is not theme related (switching theme's will have same effect, even when theme is not supporting LESS). When deactivating WP LESS, the editor works again. Thanks!