mh_trim_excerpt

The MH Corporate basic mh trim excerpt function.

Description

mh_trim_excerpt( (string) $text = '' ); 

Parameters (1)

0. $text — Optional. (string) => ''
The text.

Usage

  1. if ( !function_exists( 'mh_trim_excerpt' ) ) { 
  2. require_once '/functions.php'; 
  3.  
  4. // The text. 
  5. $text = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = mh_trim_excerpt($text); 
  9.  

Defined (1)

The function is defined in the following location(s).

/functions.php  
  1. function mh_trim_excerpt($text = '') { 
  2. $raw_excerpt = $text; 
  3. if ('' == $text) { 
  4. $text = get_the_content(''); 
  5. $text = do_shortcode($text); 
  6. $text = apply_filters('the_content', $text); 
  7. $text = str_replace(']]>', ']]>', $text); 
  8. $excerpt_length = apply_filters('excerpt_length', '200'); 
  9. $excerpt_more = apply_filters('excerpt_more', ' [...]'); 
  10. $text = wp_trim_words($text, $excerpt_length, $excerpt_more); 
  11. return apply_filters('wp_trim_excerpt', $text, $raw_excerpt);