Index: src/wp-includes/post.php
===================================================================
--- src/wp-includes/post.php	(revision 30217)
+++ src/wp-includes/post.php	(working copy)
@@ -3133,11 +3133,11 @@
 	 * @param bool  $maybe_empty Whether the post should be considered "empty".
 	 * @param array $postarr     Array of post data.
 	 */
-	if ( apply_filters( 'wp_insert_post_empty_content', $maybe_empty, $postarr ) ) {
+	if ( $id = apply_filters( 'wp_insert_post_empty_content', $maybe_empty, $postarr ) ) {
 		if ( $wp_error ) {
 			return new WP_Error( 'empty_content', __( 'Content, title, and excerpt are empty.' ) );
 		} else {
-			return 0;
+			return $id;
 		}
 	}
 
