akismet_get_user_comments_approved

Definition:
function akismet_get_user_comments_approved( $user_id, $comment_author_email, $comment_author, $comment_author_url ) {}

Parameters

  • $user_id
  • $comment_author_email
  • $comment_author
  • $comment_author_url

Source code

function akismet_get_user_comments_approved( $user_id, $comment_author_email, $comment_author, $comment_author_url ) {

	global $wpdb;

	

	if ( !empty($user_id) )

		return $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->comments WHERE user_id = %d AND comment_approved = 1", $user_id ) );

		

	if ( !empty($comment_author_email) )

		return $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->comments WHERE comment_author_email = %s AND comment_author = %s AND comment_author_url = %s AND comment_approved = 1", $comment_author_email, $comment_author, $comment_author_url ) );

		

	return 0;

}

9025

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: