pmpro_br2nl

The Paid Memberships Pro pmpro br2nl function.

Description

pmpro_br2nl( $text, (string) $tags = 'br' ); 

Parameters (2)

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

Usage

  1. if ( !function_exists( 'pmpro_br2nl' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'paid-memberships-pro/includes/functions.php'; 
  3.  
  4. // The text. 
  5. $text = null; 
  6.  
  7. // The tags. 
  8. $tags = 'br'; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = pmpro_br2nl($text, $tags); 
  12.  

Defined (1)

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

/includes/functions.php  
  1. function pmpro_br2nl($text, $tags = "br") 
  2. if(!is_array($tags)) 
  3. $tags = explode(" ", $tags); 
  4.  
  5. foreach($tags as $tag) 
  6. $text = preg_replace("/<{$tag}[^>]*>/", "\n", $text); 
  7. $text = preg_replace("/<\/{$tag}[^>]*>/", "\n", $text); 
  8.  
  9. return($text);