You appear to be a bot. Output may be restricted
Description
Determines how many days a comment will be left in the Spam queue before being deleted.
Usage
Akismet::delete_old_comments_meta();
Parameters
Returns
void
Source
File name: akismet/class.akismet.php
Lines:
1 to 29 of 29
public static function delete_old_comments_meta() { global $wpdb; $interval = apply_filters( 'akismet_delete_commentmeta_interval', 15 ); # enforce a minimum of 1 day $interval = absint( $interval ); if ( $interval < 1 ) $interval = 1; // akismet_as_submitted meta values are large, so expire them // after $interval days regardless of the comment status while ( $comment_ids = $wpdb->get_col( $wpdb->prepare( "SELECT m.comment_id FROM {$wpdb->commentmeta} as m INNER JOIN {$wpdb->comments} as c USING(comment_id) WHERE m.meta_key = 'akismet_as_submitted' AND DATE_SUB(NOW(), INTERVAL %d DAY) > c.comment_date_gmt LIMIT 10000", $interval ) ) ) { if ( empty( $comment_ids ) ) return; $wpdb->queries = array(); foreach ( $comment_ids as $comment_id ) { delete_comment_meta( $comment_id, 'akismet_as_submitted' ); do_action( 'akismet_batch_delete_count', __FUNCTION__ ); } do_action( 'akismet_delete_commentmeta_batch', count( $comment_ids ) ); } if ( apply_filters( 'akismet_optimize_table', ( mt_rand(1, 5000) == 11), $wpdb->commentmeta ) ) // lucky number $wpdb->query("OPTIMIZE TABLE {$wpdb->commentmeta}"); }