AMP_Post_Template::__construct PHP Метод

__construct() публичный Метод

public __construct ( $post_id )
    public function __construct($post_id)
    {
        $this->template_dir = apply_filters('amp_post_template_dir', AMP__DIR__ . '/templates');
        $this->ID = $post_id;
        $this->post = get_post($post_id);
        $content_max_width = self::CONTENT_MAX_WIDTH;
        if (isset($GLOBALS['content_width']) && $GLOBALS['content_width'] > 0) {
            $content_max_width = $GLOBALS['content_width'];
        }
        $content_max_width = apply_filters('amp_content_max_width', $content_max_width);
        $this->data = array('content_max_width' => $content_max_width, 'document_title' => function_exists('wp_get_document_title') ? wp_get_document_title() : wp_title('', false), 'canonical_url' => get_permalink($post_id), 'home_url' => home_url(), 'blog_name' => get_bloginfo('name'), 'html_tag_attributes' => array(), 'body_class' => '', 'site_icon_url' => apply_filters('amp_site_icon_url', function_exists('get_site_icon_url') ? get_site_icon_url(self::SITE_ICON_SIZE) : ''), 'placeholder_image_url' => amp_get_asset_url('images/placeholder-icon.png'), 'featured_image' => false, 'comments_link_url' => false, 'comments_link_text' => false, 'amp_runtime_script' => 'https://cdn.ampproject.org/v0.js', 'amp_component_scripts' => array(), 'customizer_settings' => array(), 'font_urls' => array('merriweather' => 'https://fonts.googleapis.com/css?family=Merriweather:400,400italic,700,700italic'), 'amp_analytics' => apply_filters('amp_post_template_analytics', array(), $this->post));
        $this->build_post_content();
        $this->build_post_data();
        $this->build_customizer_settings();
        $this->build_html_tag_attributes();
        $this->data = apply_filters('amp_post_template_data', $this->data, $this->post);
    }