Visual Editor Not Working – Alternative Solution
-
Symptoms: On some WP releases, up to and including 3.5.1, the Visual editor may stop working, sometimes seemingly spontaneously, and sometimes after a WP release upgrade, server change, or even in just some browsers. In some cases, even Text/HTML edit mode would display its content with the visibility:hidden css attribute and color=”white”, so it cannot be seen unless you select a section of it, and then only that section is visible.
Variations of this issue have been reported many times, and supposedly resolved and closed many times, at least as far as the original reporter is concerned, but never 100% for every situation. Some proposed solutions involve multiple diagnostic actions, such as: disabling all plugins then activating them one at a time, switching themes, re-installing fresh WP files, etc. If those methods work for you, and it works for all browsers, that’s great. But I tried all of those diagnostics and proposed solutions, all to no avail. What finally worked for me was a solution that included creating clones of the WP specific tinymce language file into two other locations with a file name that is not WP standard, but matched the files that failed to load according to Firefox/Firebug console debugging results. While it worked, the issue is that the next WP upgrade could and probably would wipe out the cloned files, as it does and should with any other core hack, so the problem could come back.
So my solution, based on the file cloning that finally solved the problem, was to create .htaccess rewrite rules to have tinymce load the correct file name instead of cloning the language files in a non-supported way. I simply added the following new rules to my .htaccess file:
# Fix invalid language file references RewriteRule ^wp-includes/js/tinymce/langs/en.js$ wp-includes/js/tinymce/langs/wp-langs-en.js [L,R=301] RewriteRule ^wp-includes/js/tinymce/themes/advanced/langs/en.js$ wp-includes/js/tinymce/langs/wp-langs-en.js [L,R=301]
Obviously, you would need to replace the language designator part of the file names to match your particular needs, if not English.
While this may still not be ideal, it could solve this issue for folks who are constrained to using a particular older theme or plugin that may not be well-behaved, according to WP Codex, or may have server configurations causing the issue and that they cannot readily access or change.
- The topic ‘Visual Editor Not Working – Alternative Solution’ is closed to new replies.