akismet_set_comment_status

Definition:
function akismet_set_comment_status( $comment_id, $status ) {}

Parameters

  • $comment_id
  • $status

Source code

function akismet_set_comment_status( $comment_id, $status ) {

	if ( $status == 'spam' ) {

		akismet_submit_spam_comment( $comment_id );

	} elseif ( $status == 'approve' ) {

		akismet_submit_nonspam_comment( $comment_id );

	}

}

483

akismet_server_connectivity_ok

Definition:
function akismet_server_connectivity_ok() {}

Source code

function akismet_server_connectivity_ok() {

	// skip the check on WPMU because the status page is hidden

	global $wpcom_api_key;

	if ( $wpcom_api_key )

		return true;

	$servers = akismet_get_server_connectivity();

	return !( empty($servers) || !count($servers) || count( array_filter($servers) ) < count($servers) );

}

481

akismet_rightnow

Definition:
function akismet_rightnow() {}

Source code

function akismet_rightnow() {

	global $submenu, $wp_db_version;



	// clean_url was deprecated in WP 3.0

	$esc_url = 'clean_url';

	if ( function_exists( 'esc_url' ) )

		$esc_url = 'esc_url';



	if ( 8645 < $wp_db_version  ) // 2.7

		$link = 'edit-comments.php?comment_status=spam';

	elseif ( isset( $submenu['edit-comments.php'] ) )

		$link = 'edit-comments.php?page=akismet-admin';

	else

		$link = 'edit.php?page=akismet-admin';



	if ( $count = get_option('akismet_spam_count') ) {

		$intro = sprintf( _n(

			'<a href="%1$s">Akismet</a> has protected your site from %2$s spam comment already. ',

			'<a href="%1$s">Akismet</a> has protected your site from %2$s spam comments already. ',

			$count

		), 'http://akismet.com/', number_format_i18n( $count ) );

	} else {

		$intro = sprintf( __('<a href="%1$s">Akismet</a> blocks spam from getting to your blog. '), 'http://akismet.com/' );

	}



	if ( $queue_count = akismet_spam_count() ) {

		$queue_text = sprintf( _n(

			'There\'s <a href="%2$s">%1$s comment</a> in your spam queue right now.',

			'There are <a href="%2$s">%1$s comments</a> in your spam queue right now.',

			$queue_count

		), number_format_i18n( $queue_count ), $esc_url($link) );

	} else {

		$queue_text = sprintf( __( "There's nothing in your <a href='%1\$s'>spam queue</a> at the moment." ), $esc_url($link) );

	}



	$text = $intro . '<br />' . $queue_text;

	echo "<p class='akismet-right-now'>$text</p>\n";

}

479

akismet_rightnow

Definition:
function akismet_rightnow() {}

Source code

function akismet_rightnow() {

	global $submenu, $wp_db_version;



	// clean_url was deprecated in WP 3.0

	$esc_url = 'clean_url';

	if ( function_exists( 'esc_url' ) )

		$esc_url = 'esc_url';



	if ( 8645 < $wp_db_version  ) // 2.7

		$link = 'edit-comments.php?comment_status=spam';

	elseif ( isset( $submenu['edit-comments.php'] ) )

		$link = 'edit-comments.php?page=akismet-admin';

	else

		$link = 'edit.php?page=akismet-admin';



	if ( $count = get_option('akismet_spam_count') ) {

		$intro = sprintf( __ngettext(

			'<a href="%1$s">Akismet</a> has protected your site from %2$s spam comment already,',

			'<a href="%1$s">Akismet</a> has protected your site from %2$s spam comments already,',

			$count

		), 'http://akismet.com/', number_format_i18n( $count ) );

	} else {

		$intro = sprintf( __('<a href="%1$s">Akismet</a> blocks spam from getting to your blog,'), 'http://akismet.com/' );

	}



	if ( $queue_count = akismet_spam_count() ) {

		$queue_text = sprintf( __ngettext(

			'and there\'s <a href="%2$s">%1$s comment</a> in your spam queue right now.',

			'and there are <a href="%2$s">%1$s comments</a> in your spam queue right now.',

			$queue_count

		), number_format_i18n( $queue_count ), clean_url($link) );

	} else {

		$queue_text = sprintf( __( "but there's nothing in your <a href='%1\$s'>spam queue</a> at the moment." ), $esc_url($link) );

	}



	// _c was deprecated in WP 2.9.0

	if ( function_exists( '_x' ) )

		$text = sprintf( _x( '%1$s %2$s', 'akismet_rightnow' ), $intro, $queue_text );

	else 

		$text = sprintf( _c( '%1$s %2$s|akismet_rightnow' ), $intro, $queue_text );



	echo "<p class='akismet-right-now'>$text</p>\n";

}

477

akismet_result_spam

Definition:
function akismet_result_spam( $approved ) {}

Parameters

  • $approved

Defined filters

  • akismet_spam_count_incr
    apply_filters('akismet_spam_count_incr', 1)

Source code

function akismet_result_spam( $approved ) {

	// bump the counter here instead of when the filter is added to reduce the possibility of overcounting

	if ( $incr = apply_filters('akismet_spam_count_incr', 1) )

		update_option( 'akismet_spam_count', get_option('akismet_spam_count') + $incr );

	// this is a one-shot deal

	remove_filter( 'pre_comment_approved', 'akismet_result_spam' );

	return 'spam';

}

475