How to Fix Visual Editor Bug When Writing a WordPress Plugin


Just wanted to make a quick note to anyone out there experimenting with writing plugins for WordPress. I made a simple little plugin and for a long time now I’ve been trying to figure out why the visual rich editor in WordPress quit working after I activated the plugin. I searched around Google and found nothing, so I decided to look at the Hello Dolly plugin and compare my code to it. I looked at the bottom of the Hello Dolly plugin and noticed one thing – there were no line breaks after the final line of code. It simply ends like:

?>

So, if you’re struggling to figure out why the visual rich editor quit working for you, check to see if you have line breaks at the end of your code. I’m not 100% positive is this is what causes the bug, but removing them has solved the problem for me. Give it a try… :)

Leave a Reply