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

February 11, 2011 


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