From ea74239f9099f136dcca8b3b5c15b6e60255ed59 Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Mon, 11 Dec 2017 06:37:50 +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. Built from https://develop.svn.wordpress.org/trunk@42383 git-svn-id: http://core.svn.wordpress.org/trunk@42212 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/post.php | 2 +- wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/post.php b/wp-includes/post.php index 94a450f438..5ebf42f89d 100644 --- a/wp-includes/post.php +++ b/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 ); diff --git a/wp-includes/version.php b/wp-includes/version.php index 6eb435a68b..d042ac7d97 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @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.