Posts, Post Types: Display a more specific error message when an attachment could not be inserted into the database.

Props shital-patel, Presskopp, ocean90.
Fixes #50325.
Built from https://develop.svn.wordpress.org/trunk@47922


git-svn-id: http://core.svn.wordpress.org/trunk@47696 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov
2020-06-07 09:24:11 +00:00
parent 171356a890
commit 18a9359c06
4 changed files with 36 additions and 6 deletions

View File

@@ -2305,7 +2305,7 @@ function wp_set_comment_status( $comment_id, $comment_status, $wp_error = false
if ( ! $wpdb->update( $wpdb->comments, array( 'comment_approved' => $status ), array( 'comment_ID' => $comment_old->comment_ID ) ) ) {
if ( $wp_error ) {
return new WP_Error( 'db_update_error', __( 'Could not update comment status' ), $wpdb->last_error );
return new WP_Error( 'db_update_error', __( 'Could not update comment status.' ), $wpdb->last_error );
} else {
return false;
}