wpp_textmaker

The WooCommerce PDF & Print wpp textmaker function.

Description

wpp_textmaker( $text ); 

Parameters (1)

0. $text
The text.

Usage

  1. if ( !function_exists( 'wpp_textmaker' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce-pdf-print/functions.php'; 
  3.  
  4. // The text. 
  5. $text = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = wpp_textmaker($text); 
  9.  

Defined (1)

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

/functions.php  
  1. function wpp_textmaker($text) 
  2. $search = array ("|\n|i"); 
  3. $replace = array ("<br> "); 
  4. $text = preg_replace($search, $replace, $text); 
  5.  
  6. $search_2 = array ("|(h\d>)[\s\t\r\n]*<br[^>]*>|i",  
  7. "|(p>)[\s\t\r\n]*<br[^>]*>|i",  
  8. "|(ul>)[\s\t\r\n]*<br[^>]*>|i",  
  9. "|(ol>)[\s\t\r\n]*<br[^>]*>|i",  
  10. "|(li>)[\s\t\r\n]*<br[^>]*>|i"); 
  11.  
  12. $replace_2 = array ("$1", "$1", "$1", "$1", "$1"); 
  13. $text=preg_replace($search_2, $replace_2, $text); 
  14.  
  15. return $text;