I'm looking at the wordpress list of actions and trying to find an action that is called when a post is restored from the trash but cannot find one. Does anyone know if it exists?
There are multiple actions. Listed in order of appearance with their parameters:
untrash_post
-(int) $post_id
// before restoringtransition_post_status
-(string) $new_status, 'trash', (object) $post
trash_to_{$new_status}
-(object) $post
// useful to address a special trash to status actionuntrash_post_comments
-(int) $post_id
// before associated comments are untrasheduntrashed_post_comments
-(int) $post_id
// after associated comments are untrasheduntrashed_post
-(int) $post_id
// after restoring
Related answer with more statuses: Execute function when post is published
-
great answer. The particular one I was looking for was
untrashed_post
. – DiverseAndRemote.com Jan 3 '13 at 23:13
I found it in wp-includes/post.php and its called untrashed_post
. For some reason wordpress chose not to include it on their action reference page at http://codex.wordpress.org/Plugin_API/Action_Reference