[wp-hackers] WordPress Uses "Wrong" Apostrophe in Blog Title

Dougal Campbell dougal at gunters.org
Fri Jul 6 14:34:19 GMT 2007


Matt wrote:
> Hello,
>
> I noticed today that WordPress is replacing ' with "’" in the Blog
> Title. But, the appropriate code should be "'".
>
> Should it not be using the "correct" apostrophe (')?

I think it depends on your definition of "correct" :)

If it bugs you, make a plugin to change the behavior. On my site, I
created a plugin for my local customizations (called "My Local
Customizations", coincidentally enough). Among other things, this includes:

  remove_filter('the_title', 'wptexturize');
  remove_filter('the_content', 'wptexturize');

In your case, you're talking about the blog title, so you would probably
want to hook into the 'blog_info' filter and  maybe 'single_post_title'.

Of course, this also undoes a lot of other automatic pretty formatting:

* curly quotes
* em- and en- dashes
* ellipses
* Trademark glyph

If you want to keep *some* of those, but not others, then you'd have to
copy the wptexturize code into your own function, do the remove_filter
as above, then add_filter your custom function.

As for me, I might re-enable wptexturize one day. I disabled it a long
time ago because it interfered with some of my more complicated code
examples. But I think we've made it smarter since then.

-- 
Dougal Campbell <dougal at gunters.org>
http://dougal.gunters.org/



More information about the wp-hackers mailing list