wp_get_post_autosave
wp_get_post_autosave ( $post_id, $user_id = 0 )
Parameters:- (int) post_id The post ID.
- (int) user_id Optional. The post author ID. Default 0.
Returns:- (WP_Post|false) The autosaved data or false on failure or when no autosave exists.
Defined at: - Introduced in WordPress: 2.6.0
- Deprecated in WordPress: —
Description
Retrieves the autosaved data of the specified post.Returns a post object with the information that was autosaved for the specified post.
If the optional $user_id is passed, returns the autosave for that user, otherwise
returns the latest autosave.