I got it working by using session variables. At the top of my functions.php I added:
session_start();
date_default_timezone_set('America/Chicago');
define("LOG_DATE_FORMAT","[d-M-Y h:i:s A T O] - "); // [10-Oct-2012 05:46:34 AM CDT -0500] -
if (empty($_SESSION['date-started'])) {
$_SESSION['date-started'] = date(LOG_DATE_FORMAT);
}
$_SESSION['date-now'] = date(LOG_DATE_FORMAT);
I added the dates so I can check the times things happen with another script that just echos out my session variables.
Within mrh_my_function that happens during the publish process I added something like:
$_SESSION['admin_msg'] = '<p>Post Tweeted! '.date(LOG_DATE_FORMAT).'</p>';
$_SESSION['mrh_my_function'] += 1; // keep track of times entered function
and removed the add_filter reference.
Then in my functions.php I modified the other function to have:
function mrh_updated_messages( $messages ) {
global $post, $post_ID, $mrh_message;
$messages["post"][6] = sprintf( __('Post published. <a href="%s">View post</a>'), esc_url( get_permalink($post_ID) ) ).$_SESSION['admin_msg'];
return $messages;
}
add_filter('post_updated_messages', 'mrh_updated_messages');
Now, when I publish a post, I can see the updated information via the admin_msg session variable.