Correct Title Case Function

Currently working on a WordPress site and the client has supplied content with the post titles all in UPPERCASE

Simple way to correct this:

add to your functions.php file in your chosen them:

function proper_title($data)  {
$data['post_title'] = ucwords(strtolower($data['post_title']));
return $data;
}
add_filter('wp_insert_post_data', 'proper_title');

Now you can paste the title all in UPPERCASE and WordPress will correct it as you publish the page, by converting to lowercase then applying Ucwords (TitleCase)

Big time saver for me, hope it helps someone else.

.html on PAGES plugin .html Wordpress permalink on PAGES plugin
Correct Title Case Correct Wordpress Title Case Function
Remove view all posts Strip 'view all posts filed under' from Cat Menu
Secure URL Attacks Help Secure Wordpress From URL Include Attacks
Develop Our Wordpress website development service
Projects Information on a small selection of our projects
Tips Some tips and ideas we would like to share
Wordpress Plugins and Functions for Wordpress Developers

3 Comments

Jonny on the 3rd of August 2010

I should mention I am trying to convert old site http://www.buildgreenenergy.info/ to WordPress 3.0. Thanks!

Jonny on the 3rd of August 2010

Hello, My website has pages with capital letters like http://www.buildgreenenergy.info/Magnetic-Motor.html . Your html plugin works perfect. How do I capitalize the "M" in Magnetic and Motor? Thanks!

Cyber on the 10th of April 2010

Thanks for the code, helps much!

Leave a comment




Name and email address required, website must be related
08445 008 009