WordPress Smart Capitalization
function friendlycase($title) {
$title = preg_replace( "/(?< =(?<!:|'s)\W)(A|An|And|At|For|In|Of|On|Or|The|To|With)(?=\W)/e", 'strtolower("$1")', ucwords(strtolower($title)));
return $title;
}
add_filter('the_title', 'friendlycase');
Short sweet and it works… so “HELLO SAUL…THIS IS MOTHRA” becomes “Hello Saul…this is Mothra” particularly handy when someone has a tendency to type in all caps. Painfully simple to add your own exclusionary words..
SEE? I KNEW IT COULD BE DONE :)