Skip to content

Commit a14f848

Browse files
Return early if wp_delete_comment fails
1 parent cef8390 commit a14f848

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/wp-includes/comment.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1583,6 +1583,11 @@ function wp_trash_comment( $comment_id ) {
15831583
if ( ! EMPTY_TRASH_DAYS ) {
15841584
$comment = get_comment( $comment_id );
15851585
$success = wp_delete_comment( $comment_id, true );
1586+
1587+
if ( ! $success ) {
1588+
return false;
1589+
}
1590+
15861591
// Also delete children of top level 'note' type comments.
15871592
if ( $comment && 'note' === $comment->comment_type && 0 === (int) $comment->comment_parent ) {
15881593
$children = $comment->get_children(

0 commit comments

Comments
 (0)