diff --git a/src/wp-includes/post.php b/src/wp-includes/post.php index 2e70023a20..eaeedd5053 100644 --- a/src/wp-includes/post.php +++ b/src/wp-includes/post.php @@ -3146,7 +3146,7 @@ function wp_insert_post( $postarr, $wp_error = false ) { } $post_status = empty( $postarr['post_status'] ) ? 'draft' : $postarr['post_status']; - if ( 'attachment' === $post_type && ! in_array( $post_status, array( 'inherit', 'private' ) ) ) { + if ( 'attachment' === $post_type && ! in_array( $post_status, array( 'inherit', 'private', 'trash' ) ) ) { $post_status = 'inherit'; }