Hi is there an action which can be performed while a post is moved to trash …. I tried delete_post and deleted_post. It works but twice for each action ( before and after the action as written in codex ) and the output is shown only when the post is deleted from trash. Example i want to send an email to the author stating that his post has been moved to trash because of some reason, and update some user_meta. if i use
add_action('deleted_post', 'emailUser');
or
add_action('delete_post', 'emailUser');
it works only when the post is deleted from trash . . .
Update : got it to work for trash posts using
add_action('trash_post', 'emailUser');
but the problem for double execution of function is still there. . .