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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user