WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm writing a plugin that sends notifications on various post events. One of the notifications should be sent when a post is assigned to a different author. How can I know that the post author was changed ?

share|improve this question
up vote 4 down vote accepted

Best Hook for that would be wp_insert_post_data

function wpse44358_filter_handler( $data , $postarr ){ 
    //do your stuff 
    //if ($data['post_author'] == ...
    return data; // make sure you return something 

add_filter( 'wp_insert_post_data' , 'wpse44358_filter_handler' , '99', 2 );
share|improve this answer
Thanks, works like a charm... – hannit cohen Mar 4 '12 at 11:38

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.