diff --git a/wp-includes/post.php b/wp-includes/post.php index fea5c0e7f9..375fce3caa 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -3059,13 +3059,17 @@ function wp_trash_post( $post_id = 0 ) { add_post_meta( $post_id, '_wp_trash_meta_status', $post->post_status ); add_post_meta( $post_id, '_wp_trash_meta_time', time() ); - wp_update_post( + $post_updated = wp_update_post( array( 'ID' => $post_id, 'post_status' => 'trash', ) ); + if ( ! $post_updated ) { + return false; + } + wp_trash_post_comments( $post_id ); /** @@ -3126,13 +3130,17 @@ function wp_untrash_post( $post_id = 0 ) { delete_post_meta( $post_id, '_wp_trash_meta_status' ); delete_post_meta( $post_id, '_wp_trash_meta_time' ); - wp_update_post( + $post_updated = wp_update_post( array( 'ID' => $post_id, 'post_status' => $post_status, ) ); + if ( ! $post_updated ) { + return false; + } + wp_untrash_post_comments( $post_id ); /** diff --git a/wp-includes/version.php b/wp-includes/version.php index 2bf3164ae7..8132d61a41 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.3-alpha-45723'; +$wp_version = '5.3-alpha-45724'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.