Timber\Post::content PHP Метод

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

Gets the actual content of a WP Post, as opposed to post_content this will run the hooks/filters attached to the_content. \This guy will return your posts content with WordPress filters run on it (like for shortcodes and wpautop).
public content ( integer $page, $len ) : string
$page integer
Результат string
    public function content($page = 0, $len = -1)
    {
        if ($form = $this->maybe_show_password_form()) {
            return $form;
        }
        if ($len == -1 && $page == 0 && $this->_content) {
            return $this->_content;
        }
        $content = $this->post_content;
        if ($len > 0) {
            $content = wp_trim_words($content, $len);
        }
        if ($page) {
            $contents = explode('<!--nextpage-->', $content);
            $page--;
            if (count($contents) > $page) {
                $content = $contents[$page];
            }
        }
        $content = apply_filters('the_content', $content);
        if ($len == -1 && $page == 0) {
            $this->_content = $content;
        }
        return $content;
    }