protected function prepare_links($post, $request) { $links = array('self' => array('href' => rest_url(sprintf('/%s/%s/%d', $this->namespace, $this->rest_base, $post->ID))), 'collection' => array('href' => rest_url(sprintf('/%s/%s', $this->namespace, $this->rest_base)))); return $links; }