akismet_spam_totals

Definition:
function akismet_spam_totals() {}

Source code

function akismet_spam_totals() {

	global $wpdb;

	$totals = $wpdb->get_results( "SELECT comment_type, COUNT(*) AS cc FROM $wpdb->comments WHERE comment_approved = 'spam' GROUP BY comment_type" );

	$return = array();

	foreach ( $totals as $total )

		$return[$total->comment_type ? $total->comment_type : 'comment'] = $total->cc;

	return $return;

}

493

akismet_spam_count

Definition:
function akismet_spam_count( $type = false ) {}

Parameters

  • $type

Source code

function akismet_spam_count( $type = false ) {

	global $wpdb;



	if ( !$type ) { // total

		$count = wp_cache_get( 'akismet_spam_count', 'widget' );

		if ( false === $count ) {

			if ( function_exists('wp_count_comments') ) {

				$count = wp_count_comments();

				$count = $count->spam;

			} else {

				$count = (int) $wpdb->get_var("SELECT COUNT(comment_ID) FROM $wpdb->comments WHERE comment_approved = 'spam'");

			}

			wp_cache_set( 'akismet_spam_count', $count, 'widget', 3600 );

		}

		return $count;

	} elseif ( 'comments' == $type || 'comment' == $type ) { // comments

		$type = '';

	} else { // pingback, trackback, ...

		$type  = $wpdb->escape( $type );

	}



	return (int) $wpdb->get_var("SELECT COUNT(comment_ID) FROM $wpdb->comments WHERE comment_approved = 'spam' AND comment_type='$type'");

}

491

akismet_spam_count

Definition:
function akismet_spam_count( $type = false ) {}

Parameters

  • $type

Source code

function akismet_spam_count( $type = false ) {

	global $wpdb;



	if ( !$type ) { // total

		$count = wp_cache_get( 'akismet_spam_count', 'widget' );

		if ( false === $count ) {

			if ( function_exists('wp_count_comments') ) {

				$count = wp_count_comments();

				$count = $count->spam;

			} else {

				$count = (int) $wpdb->get_var("SELECT COUNT(comment_ID) FROM $wpdb->comments WHERE comment_approved = 'spam'");

			}

			wp_cache_set( 'akismet_spam_count', $count, 'widget', 3600 );

		}

		return $count;

	} elseif ( 'comments' == $type || 'comment' == $type ) { // comments

		$type = '';

	} else { // pingback, trackback, ...

		$type  = $wpdb->escape( $type );

	}



	return (int) $wpdb->get_var("SELECT COUNT(comment_ID) FROM $wpdb->comments WHERE comment_approved = 'spam' AND comment_type='$type'");

}

489

akismet_spam_comments

Definition:
function akismet_spam_comments( $type = false, $page = 1, $per_page = 50 ) {}

Parameters

  • $type
  • $page
  • $per_page

Source code

function akismet_spam_comments( $type = false, $page = 1, $per_page = 50 ) {

	global $wpdb;



	$page = (int) $page;

	if ( $page < 2 )

		$page = 1;



	$per_page = (int) $per_page;

	if ( $per_page < 1 )

		$per_page = 50;



	$start = ( $page - 1 ) * $per_page;

	$end = $start + $per_page;



	if ( $type ) {

		if ( 'comments' == $type || 'comment' == $type )

			$type = '';

		else

			$type = $wpdb->escape( $type );

		return $wpdb->get_results( "SELECT * FROM $wpdb->comments WHERE comment_approved = 'spam' AND comment_type='$type' ORDER BY comment_date DESC LIMIT $start, $end");

	}



	// All

	return $wpdb->get_results( "SELECT * FROM $wpdb->comments WHERE comment_approved = 'spam' ORDER BY comment_date DESC LIMIT $start, $end");

}

487

akismet_spamtoham

Definition:
function akismet_spamtoham( $comment ) { akismet_submit_nonspam_comment( $comment->comment_ID ); }

Parameters

  • $comment

Source code

function akismet_spamtoham( $comment ) { akismet_submit_nonspam_comment( $comment->comment_ID ); }

485