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.

git-svn-id: https://develop.svn.wordpress.org/trunk@47922 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov
2020-06-07 09:22:07 +00:00
parent 4fb1e58c50
commit d3387a2161
3 changed files with 35 additions and 5 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;
}