How to Fix Visual Editor Bug When Writing a WordPress Plugin

by manatee on April 30, 2008

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… :)

More Awesome Blog Posts

{ 0 comments… add one now }

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>