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

No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: