Get the content of the current post.

@param string $more_text    Content to show when there is more text.
@param bool   $strip_teaser Strip teaser content before the more text.

@return string The content of the current post.
359044
public function content($more_text = null, $strip_teaser = false)
    {
        $content = apply_filters('the_content', get_the_content($more_text, $strip_teaser));
        $content = str_replace(']]>', ']]&gt;', $content);

        return $content;
    }
232934
private function excerpt(Post $post, int $count): string
    {
        $out = '';

        if ($this->posts->isContent()) {
            return $out;
        }

        $excerpt = $post->excerpt(
            $this->posts->args['excerpt']['length'],
            $this->posts->args['excerpt']['more_text']
        );

        if (!$excerpt) {
            return $out;
        }

        $out .= '<div '.$this->textOffset($post).
            ' class="entry-summary" itemprop="description">';
        $out .= $excerpt;
        $out .= '</div><!-- .entry-summary -->';

        return $out;
    }
113286
public function getContentForTeaser()
    {
        $content = $this->row['content'];
        if (!empty($this->row['abstract'])) {
            $content = nl2br($this->row['abstract']);
            if ($this->conf['previewMode'] == 'hit') {
                if (!$this->isArrayOfWordsInString($this->pObj->swords, $this->row['abstract'])) {
                    $content = $this->row['content'];
                }
            }
        }
        return $content;
    }
128447
function fetch( $addPHPMarkers = true )
    {
        if ( $addPHPMarkers )
            $this->write( "<?php\n" );
        $this->writeElements();
        if ( $addPHPMarkers )
            $this->write( "?>\n" );

        $text = implode( '', $this->TextChunks );

        $this->flushChunks();

        return $text;
    }
319897
public function getContentSummary(DBHTMLText $content, $maxWords = 50, $add = '...')
    {
        // Get Plain Text Version:
        
        $value = $this->getContentAsPlainText($content);
        
        // Bail Early (if empty):
        
        if (!$value) {
            return '';
        }
        
        // Split on Sentences (do not remove period):
        
        $sentences = array_filter(array_map(function ($str) {
            return trim($str);
        }, preg_split('@(?<=\.)@', $value)));
        
        $wordCount = count(preg_split('#\s+#u', $sentences[0]));
        
        // If the First Sentence is Too Long, Show Only the First $maxWords Words:
        
        if ($wordCount > $maxWords) {
            return implode(' ', array_slice(explode(' ', $sentences[0]), 0, $maxWords)) . $add;
        }
        
        // Add Each Sentence (while there are enough words to do so):
        
        $result = '';
        
        do {
            
            // Add Next Sentence:
            
            $result .= ' ' . array_shift($sentences);
            
            // If More Sentences, Count Number of Words:
            
            if ($sentences) {
                $wordCount += count(preg_split('#\s+#u', $sentences[0]));
            }
            
        } while ($wordCount < $maxWords && $sentences && trim($sentences[0]));
        
        // Answer Result String:
        
        return trim($result);
    }
1026703
def text(el, strip=True):
    
    if not el:
        return ""

    text = el.text
    if strip:
        text = text.strip()
    return text
748519
public function getShortContent($url, $text)
    {
        $readMoreText = sprintf('... <a href="%s" class="read_more">%s <span class="fa fa-long-arrow-right"></span></a>', $url, $text);

        return StringUtils::resumeHtml($this->content, 400, $readMoreText);
    }
671411
def get_text(revision, strip=True):
  
  # text start tag looks like "<text ..otherstuff>"
  start_pos = revision.find("<text")
  assert start_pos != -1
  end_tag_pos = revision.find(">", start_pos)
  assert end_tag_pos != -1
  end_tag_pos += len(">")
  end_pos = revision.find("</text>")
  if end_pos == -1:
    ret = ""
  else:
    ret = revision[end_tag_pos:end_pos]
  if strip:
    ret = strip_text(ret)
  ret = text_encoder.to_unicode_utf8(ret)
  return ret
119166
public function getContent($deletedCommentText = NULL)
    {
        if (is_null($deletedCommentText))
        {
            $deletedCommentText = Yii::t('app', 'Comment was deleted.');
        }

        return $this->isDeleted ? $deletedCommentText : Yii::$app->formatter->asNtext($this->content);
    }
328992
private function content(Post $post, int $count): string
    {
        $out = '';

        if (!$this->posts->isContent()) {
            return $out;
        }

        $content = $post->content(
            $this->posts->args['excerpt']['more_text'],
            '',
            $this->posts->args['excerpt']['paginate']
        );

        if (!$content) {
            return $out;
        }

        $out .= '<div class="entry-content" itemprop="articleBody">';
        $out .= $content;
        $out .= '</div><!-- .entry-content -->';

        return $out;
    }
468514
protected function get_stripped_file_contents($fullpath) {

        $source = file_get_contents($fullpath);
        $tokens = token_get_all($source);
        $output = '';
        $doprocess = false;
        foreach ($tokens as $token) {
            if (is_string($token)) {
                // Simple one character token.
                $id = -1;
                $text = $token;
            } else {
                // Token array.
                list($id, $text) = $token;
            }
            switch ($id) {
                case T_WHITESPACE:
                case T_COMMENT:
                case T_ML_COMMENT:
                case T_DOC_COMMENT:
                    // Ignore whitespaces, inline comments, multiline comments and docblocks.
                    break;
                case T_OPEN_TAG:
                    // Start processing.
                    $doprocess = true;
                    break;
                case T_CLOSE_TAG:
                    // Stop processing.
                    $doprocess = false;
                    break;
                default:
                    // Anything else is within PHP tags, return it as is.
                    if ($doprocess) {
                        $output .= $text;
                        if ($text === 'function') {
                            // Explicitly keep the whitespace that would be ignored.
                            $output .= ' ';
                        }
                    }
                    break;
            }
        }

        return $output;
    }
743283
function (options) {
      options = options || {};
      lazy.extend(options, this.options.excerpt || {});

      var re = /<!--+\s*more\s*--+>/;
      var str = this.content;
      var view = this;

      var link = options.link || '<a id="more"></a>';

      this.content = str.replace(re, function (match, i) {
        view.data.excerpt = str.slice(0, i).trim();
        view.data.more = str.slice(i + match.length).trim() + link;
        return '';
      });
      return this;
    }
1129176
function getContentItemSelection($data=false)
    {
        if ( ! $data ) $data = LTIX::ltiRawParameter('data');
        return parent::getContentItemSelection($data);
    }
691340
public static function pure_trim_excerpt() {
		$raw_excerpt = '';

		$text = static::get_pure_post_content();
		$text = strip_shortcodes( $text );
		$text = str_replace( ']]>', ']]&gt;', $text );

		$excerpt_length = apply_filters( 'excerpt_length', 55 );
		$excerpt_more   = apply_filters( 'excerpt_more', ' [&hellip;]' );

		$text = wp_trim_words( $text, $excerpt_length, $excerpt_more );

		return apply_filters( 'wp_trim_excerpt', $text, $raw_excerpt );
	}
1178377
protected function _getContent($asArray = true)
    {
        if (!empty($this->current) &&
            !empty($this->current[0]) &&
            !empty($this->current[0]->content)
        ) {
            if ($asArray) {
                $content = json_decode($this->current[0]->content, true);
                return Hash::get($content, 'content', []);
            }
            return $this->current[0]->content;
        }

        if ($asArray) {
            return [];
        }

        return '';
    }
181205
public function getCurrentRequestContent()
    {
        if ($this->requestStack->getCurrentRequest() instanceof Request) {
            return $this->requestStack->getCurrentRequest()->getContent();
        }
        return null;
    }
851923
public function getPrevious()
    {
        $prev = $this;
        $find = false;
        if (!is_null($this->parent)) {
            foreach ($this->parent->content as $c) {
                if ($c === $this) {
                    $find=true;
                    break;
                }
                if (!$find) {
                    $prev = $c;
                }
            }
        }
        return $prev;
    }