private function build_post_commments_data() { if (!post_type_supports($this->post->post_type, 'comments')) { return; } $comments_open = comments_open($this->ID); // Don't show link if close and no comments if (!$comments_open && !$this->post->comment_count) { return; } $comments_link_url = get_comments_link($this->ID); $comments_link_text = $comments_open ? __('Leave a Comment', 'amp') : __('View Comments', 'amp'); $this->add_data(array('comments_link_url' => $comments_link_url, 'comments_link_text' => $comments_link_text)); }