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.

Built from https://develop.svn.wordpress.org/trunk@42383


git-svn-id: http://core.svn.wordpress.org/trunk@42212 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Dion Hulse 2017-12-11 06:37:50 +00:00
parent 24a94c55ae
commit ea74239f90
2 changed files with 2 additions and 2 deletions

View File

@ -3806,7 +3806,7 @@ function wp_update_post( $postarr = array(), $wp_error = false ) {
} }
if ( $postarr['post_type'] == 'attachment' ) { 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 ); return wp_insert_post( $postarr, $wp_error );

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '5.0-alpha-42382'; $wp_version = '5.0-alpha-42383';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.