wp_restore_post_revision
wp_restore_post_revision ( $revision, $fields = null )
Parameters:- (int|WP_Post) revision Revision ID or revision object.
- (array) fields Optional. What fields to restore from. Defaults to all.
Returns:- (int|false|null) Null if error, false if no fields to restore, (int) post ID if success.
Defined at: - Introduced in WordPress: 2.6.0
- Deprecated in WordPress: —
Description
Restores a post to the specified revision.Can restore a past revision using all fields of the post revision, or only selected fields.