protected function prepare_links($activity)
{
$base = sprintf('/%s/%s/', $this->namespace, $this->rest_base);
// Entity meta.
$links = array('self' => array('href' => rest_url($base . $activity->id)), 'collection' => array('href' => rest_url($base)), 'author' => array('href' => rest_url('/wp/v2/users/' . $activity->user_id)));
if ($activity->type === 'activity_comment') {
$links['up'] = array('href' => rest_url($base . $activity->item_id));
}
return $links;
}