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?
Leave a Reply
You must be logged in to post a comment.
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?
You must be logged in to post a comment.
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 restoringRelated answer with more statuses: Execute function when post is published
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