From 9fed02f896281af2902addae2f3a0d5f66f10ef4 Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Mon, 11 Dec 2017 06:36:13 +0000 Subject: [PATCH] Posts: When using `wp_update_post()` on a `attachment` post_type item, pass the `$wp_error` parameter through to `wp_insert_attachment()`. Props MyThemeShop. Fixes #41513. git-svn-id: https://develop.svn.wordpress.org/trunk@42383 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/post.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-includes/post.php b/src/wp-includes/post.php index 94a450f438..5ebf42f89d 100644 --- a/src/wp-includes/post.php +++ b/src/wp-includes/post.php @@ -3806,7 +3806,7 @@ function wp_update_post( $postarr = array(), $wp_error = false ) { } if ( $postarr['post_type'] == 'attachment' ) { - return wp_insert_attachment( $postarr ); + return wp_insert_attachment( $postarr, false, 0, $wp_error ); } return wp_insert_post( $postarr, $wp_error );