获取用户的metas值:
$user_meta = get_user_meta($user_id, \'YOUR_META_KEY\', TRUE); //You have to set the $user_id / And the "YOUR_META_KEY" can be description, name, custom meta...
获取用户评论计数
function commentCount($userId = null) {
global $wpdb;
if($userId == null) return 0;
$count = $wpdb->get_var(\'
SELECT COUNT(comment_ID)
FROM \' . $wpdb->comments. \'
WHERE user_id = "\' . $userId . \'"\');
return (int)$count;
}
最后,获取用户的帖子数量
$user_post_count = count_user_posts( $userId , \'post\' );