evolved_formating

The Evolved evolved formating function.

Description

evolved_formating( $content ); 

Parameters (1)

0. $content
The content.

Usage

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

Defined (1)

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

/functions.php  
  1. function evolved_formating($content) { 
  2. $new_content = ''; 
  3. $pattern_full = '{(\[raw\].*?\[/raw\])}is'; 
  4. $pattern_contents = '{\[raw\](.*?)\[/raw\]}is'; 
  5. $pieces = preg_split($pattern_full, $content, -1, PREG_SPLIT_DELIM_CAPTURE); 
  6.  
  7. foreach ($pieces as $piece) { 
  8. if (preg_match($pattern_contents, $piece, $matches)) { 
  9. $new_content .= $matches[1]; 
  10. } else { 
  11. $new_content .= wptexturize(wpautop($piece)); 
  12.  
  13. return $new_content;