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
This commit is contained in:
Dion Hulse 2017-12-11 06:36:13 +00:00
parent a7488c9441
commit 9fed02f896
1 changed files with 1 additions and 1 deletions

View File

@ -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 );