Turning off WordPress syntax highlighting
When I first saw that syntax highlighting would be available with WordPress 2.8, I thought it was a great idea. If you're using the WordPress built-in editor to amend themes or plugins on your live installation, you need to get it right first time, so having the source code display in different colours should help avoid mistakes, right? Except it turns out - frankly - to be a complete pain.
The colours are fine. But what I really don't like is every time I type an inverted comma, a double quote or some kind of bracket, WP slaps in another one: I'm sure it's meant to help me remember to close my quotes and my brackets, but I already remember to do this all by myself
Inevitably - because I've been typing pairs of quotes and brackets for years - I then type a third one, don't notice, and end up with PHP errors which I then have to go back and fix.
The new editor also doesn't treat white space as white space: if I paste in something with a space in it, that gets translated into a non-breaking space ( ) which again, gives me errors I have to go back and fix.
I was surprised I wasn't seeing lots of complaints about this. Then last night I discovered that it's because there's a really easy way to turn it off. From either the plugin editor or the theme editor (the same setting is used for both), click "screen options" from the top right, then the "disable syntax highlighting" link from the top left, and you're back to the normal text editor you know and love. Thank goodness for that.
Tags: edit themes, WordPress admin
Posted by Sue on June 27, 2009 in WordPress.







