ここのstackoverflowで親友によって投稿されたグループtopic.phpの下のbudypressのcubepointsポイントを呼び出す関数があります:
add_filter('bp_get_the_topic_time_since_last_post','bp_forum_extras_get_the_topic_time_since_last_post');
add_action('bp_get_the_topic_post_poster_avatar', 'topic_poster_avatar');
function topic_poster_avatar($avatar) {
preg_match_all('/user-([0-9]+)-avatar/', $avatar, $m);
$id = $m[1][0];
if ($count = get_user_meta($id, 'cpoints', 1))
return $avatar . '<div class="cp-avatar-counter"><center><span class="number">' . $count . '</span> Points</center></div>';
return $avatar;
}
バディプレスの関数として、キューブポイントのランクを呼び出す関数を知っているかどうか知りたいですか?以下のコードは、バディプレスではなく BB プレスに使用されます。cp_module_ranks_getRank を使用してキューブポイントのランクを呼び出す必要がありますが、それを上記のような関数にするにはどうすればよいですか?
<?php echo cp_module_ranks_getRank( bp_displayed_user_id() ); ?>