Thread Starter
mwrmwr
(@mwrmwr)
I read that thread but am left with not knowing or understanding what the current status is re javascript. Is there a way (plugin?) that prevents the removal of javascript in the editor?
What are the supposed security risks? I have admin status.
So the flipping between visual and text edit modes in the editor causing the JavaScript to get removed is a bug of sorts (meaning it’s not intended behavior). But inserting JavaScript into the editor (and thus the content) can be a security issue as well (malicious JS code is not unheard of). So the WordPress core developers have, for now, not fixed the problem and instead encourage users who need JavaScript to be inserted into their content, to use a plugin or shortcodes to provide that capability.
In other words, WordPress core developers won’t be fixing this, instead you will need to use something like https://gist.github.com/adamsilverstein/7741b38133fe3a593382 in your functions.php file or use a plugin that provides similar functionality to work around the “bug” that won’t be fixed because there’s better/safer ways of handling it.