diff options
Diffstat (limited to 'plugins/akismet/class.akismet.php')
-rw-r--r-- | plugins/akismet/class.akismet.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/plugins/akismet/class.akismet.php b/plugins/akismet/class.akismet.php index 32b23ea8..867430fc 100644 --- a/plugins/akismet/class.akismet.php +++ b/plugins/akismet/class.akismet.php @@ -701,7 +701,13 @@ class Akismet { foreach ( (array) $comment_errors as $comment_id ) { // if the comment no longer exists, or is too old, remove the meta entry from the queue to avoid getting stuck $comment = get_comment( $comment_id ); - if ( !$comment || strtotime( $comment->comment_date_gmt ) < strtotime( "-15 days" ) ) { + + if ( + ! $comment // Comment has been deleted + || strtotime( $comment->comment_date_gmt ) < strtotime( "-15 days" ) // Comment is too old. + || $comment->comment_approved !== "0" // Comment is no longer in the Pending queue + ) { + echo "Deleting"; delete_comment_meta( $comment_id, 'akismet_error' ); delete_comment_meta( $comment_id, 'akismet_delayed_moderation_email' ); continue; |