From f718b4b6ec5a471c147b5e8a12253995469c4934 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sat, 11 Jul 2020 21:15:06 +0000 Subject: [PATCH] Revisions: Restore the return value of `wp_get_post_autosave()` to the documented type of `WP_Post` for backward compatibility. Follow-up to [48422]. See #34560. Built from https://develop.svn.wordpress.org/trunk@48438 git-svn-id: http://core.svn.wordpress.org/trunk@48207 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/revision.php | 10 +++++----- wp-includes/version.php | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/wp-includes/revision.php b/wp-includes/revision.php index 119bef816b..b0f806bc68 100644 --- a/wp-includes/revision.php +++ b/wp-includes/revision.php @@ -221,9 +221,9 @@ function wp_save_post_revision( $post_id ) { /** * Retrieve the autosaved data of the specified post. * - * Returns an object containing 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. + * 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. * * @since 2.6.0 * @@ -237,7 +237,7 @@ function wp_get_post_autosave( $post_id, $user_id = 0 ) { $autosave_name = $post_id . '-autosave-v1'; $user_id_query = ( 0 !== $user_id ) ? "AND post_author = $user_id" : null; - // Construct the autosave query + // Construct the autosave query. $autosave_query = " SELECT * FROM $wpdb->posts @@ -260,7 +260,7 @@ function wp_get_post_autosave( $post_id, $user_id = 0 ) { return false; } - return $autosave[0]; + return get_post( $autosave[0] ); } /** diff --git a/wp-includes/version.php b/wp-includes/version.php index ba51c17733..d400db0425 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.5-beta1-48437'; +$wp_version = '5.5-beta1-48438'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.