// because we don't know the comment ID at that point.
public static function auto_check_update_meta( $id,
$comment ) { // wp_insert_comment() might be called in other contexts, so make sure this is the same comment
// as was checked by auto_check_comment
if ( is_object( $comment ) && !
empty( self::
$last_comment ) &&
is_array( self::
$last_comment ) ) { if ( self::
matches_last_comment( $comment ) ) { load_plugin_textdomain( 'akismet'
);
// normal result: true or false
if ( self::
$last_comment['akismet_result'
] == 'true'
) { update_comment_meta( $comment->comment_ID, 'akismet_result', 'true'
);
self::
update_comment_history( $comment->comment_ID, '', 'check-spam'
);
if ( $comment->comment_approved != 'spam'
) { self::
update_comment_history( $comment->comment_ID,
'',
'status-changed-' .
$comment->comment_approved
);
} } elseif ( self::
$last_comment['akismet_result'
] == 'false'
) { update_comment_meta( $comment->comment_ID, 'akismet_result', 'false'
);
self::
update_comment_history( $comment->comment_ID, '', 'check-ham'
);
// Status could be spam or trash, depending on the WP version and whether this change applies: