AMP_Post_Template::build_post_data PHP Method

build_post_data() private method

private build_post_data ( )
    private function build_post_data()
    {
        $post_title = get_the_title($this->ID);
        $post_publish_timestamp = get_the_date('U', $this->ID);
        $post_modified_timestamp = get_post_modified_time('U', false, $this->post);
        $post_author = get_userdata($this->post->post_author);
        $this->add_data(array('post' => $this->post, 'post_id' => $this->ID, 'post_title' => $post_title, 'post_publish_timestamp' => $post_publish_timestamp, 'post_modified_timestamp' => $post_modified_timestamp, 'post_author' => $post_author));
        $metadata = array('@context' => 'http://schema.org', '@type' => 'BlogPosting', 'mainEntityOfPage' => $this->get('canonical_url'), 'publisher' => array('@type' => 'Organization', 'name' => $this->get('blog_name')), 'headline' => $post_title, 'datePublished' => date('c', $post_publish_timestamp), 'dateModified' => date('c', $post_modified_timestamp), 'author' => array('@type' => 'Person', 'name' => $post_author->display_name));
        $site_icon_url = $this->get('site_icon_url');
        if ($site_icon_url) {
            $metadata['publisher']['logo'] = array('@type' => 'ImageObject', 'url' => $site_icon_url, 'height' => self::SITE_ICON_SIZE, 'width' => self::SITE_ICON_SIZE);
        }
        $image_metadata = $this->get_post_image_metadata();
        if ($image_metadata) {
            $metadata['image'] = $image_metadata;
        }
        $this->add_data_by_key('metadata', apply_filters('amp_post_template_metadata', $metadata, $this->post));
        $this->build_post_featured_image();
        $this->build_post_commments_data();
    }