Wordpress is the most popular web publishing platform and, IMHO one of the worst implemented pieces software. Last time I looked their coding practices were ancient (even by PHP standards). I know that popular stuff attracts crappy coders, but it's so crappy that it either will force you to write crap or frustrate you so much that you don't even care.
The wordpress phenomenon never ceases to amaze me. I know it's nothing special, cause there's probably tons of crap in proprietary closed-source software that's even more popular - but then at least you can't see it.
The only fix is a rewrite and they won't do it because it would break compatibility. (Or something?)
DISCLAIMER: This post may be based on outdated knowledge. Maybe wordpress is state-of-the-art now with their shiny, perfect codebase.