Skip to content

Changing various annoying aspects of WordPress

Yesterday, I came across two behaviors of WordPress (v 2.6.3), that I wanted to change:

  • the HTML editor sanitizes code in a post if you use the visual editing mode.
  • WordPress changes regular single and double quotation marks into "smart quotes", which causes major problems for snippets of code

One way to change this behavior is to edit some of the WordPress source code (the first issues could be resolved by edits described in WordPress Editor Fix to Stop Stripping or Changing Code and the second, by changes shown in phpied.com » Blog Archive » Smart quotes in WP).

However, I was hoping that someone had come up with an approach that would not involve changing WordPress code directly, such as writing up WordPress plug-in to make the change. In the second case (of disabling smart quotes), I did find and install the Unfancy Quote Plugin For WordPress, which "lets you override WordPress' quote fancification". In the first case, I was not able to find such an appropriate plug-in and so would have to write one myself. (WordPress › TinyMCE Advanced « WordPress Plugins might be close to what I want.)

Another possible approach is to mess with my-hacks.php — although that's clearly a legacy approach. A final approach would be to stop using the visual editing mode altogether — that's the workaround that I'll use right now.

(I definitely would like to learn how to write a WordPress plug-in (Writing a Plugin « WordPress Codex) — though not today. There's a good chance I will want to render my mashup book in the form of a WordPress site — and I figure I'll have to write a plug-in or two to make that happen.)

Post a Comment

You must be logged in to post a comment.