get_var(' SELECT COUNT(ID) FROM ' . $wpdb->posts. ' WHERE post_author = "' . $user_id . '" ' . $post_status_where . ' AND post_type = "' . $post_type . '"' ); return $count; } /** * Gets the comment count. * * @since 1.0.0 * @package userswp * @param int $user_id User ID. * @return int Comment count. */ function uwp_comment_count($user_id) { global $wpdb; $count = $wpdb->get_var( "SELECT COUNT(comment_ID) FROM ".$wpdb->comments." WHERE comment_post_ID in ( SELECT ID FROM ".$wpdb->posts." WHERE post_type = 'post' AND post_status = 'publish') AND user_id = " . $user_id . " AND comment_approved = '1' AND comment_type NOT IN ('pingback', 'trackback' )" ); return $count; }