Welcome, visitor! Log in
 

Source View: the_content

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN  (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

  • Action hooks look like this: do_action( "hook_name" )
  • Filter hooks look like this: apply_filters( "hook_name", "what_to_filter" ).

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
1793   * The 55 word limit can be modified by plugins/themes using the excerpt_length filter
1794   * The ' [...]' string can be modified by plugins/themes using the excerpt_more filter
1795   *
1796   * @since 1.5.0
1797   *
1798   * @param string $text The excerpt. If set to empty an excerpt is generated.
1799   * @return string The excerpt.
1800   */
1801  function wp_trim_excerpt($text) {
1802       $raw_excerpt = $text;
1803       if ( '' == $text ) {
1804            $text = get_the_content('');
1805  
1806            $text = strip_shortcodes( $text );
1807  
1808            $text = apply_filters('the_content', $text);
1809            $text = str_replace(']]>', ']]>', $text);
1810            $text = strip_tags($text);
1811            $excerpt_length = apply_filters('excerpt_length', 55);
1812            $excerpt_more = apply_filters('excerpt_more', ' ' . '[...]');
1813            $words = explode(' ', $text, $excerpt_length + 1);
1814            if (count($words) > $excerpt_length) {
1815                 array_pop($words);
1816                 $text = implode(' ', $words);
1817                 $text = $text . $excerpt_more;
1818            }
1819       }
1820       return apply_filters('wp_trim_excerpt', $text, $raw_excerpt);
1821  }
1822  
1823  /**