I created a custom WordPress plug-in that hooks onto 'save_post" using add_filter(). I need to do something with the post titles and whenever a user changes the title, my plug-in cannot get the new title until the post is updated a second time (without changing the title in the admin a second time).

For example, I have a post named "WordPress Rocks". I change it to "WordPress is Cool", but my plug-in shows the title as being "WordPress Rocks" using get_the_title($post_id) when updating the post. I go back and make a second update to the post, this time without changing the title. This next time, get_the_title($post_id) shows the title is "WordPress is Cool".

How can I grab the updated title (if it's changed) as soon as the post is updated?

Thanks for the response! I'm confused about where to run do_action(). Here is how I'm calling save_post: public function __construct() { add_filter("save_post", array($this, "runCode")); }
–
user1462Dec 7 '12 at 18:21

sorry, these bits are from core source where the actions you're hooking are actually called. see the $accepted_args argument of add_action to access the additional passed data. also note save_post is an action, not a filter!
–
MiloDec 7 '12 at 18:27