bb_decodeit

The BuddyPress bb decodeit function.

Description

bb_decodeit( $matches ); 

Parameters (1)

0. $matches
The matches.

Usage

  1. if ( !function_exists( 'bb_decodeit' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-forums/bbpress/bb-includes/functions.bb-formatting.php'; 
  3.  
  4. // The matches. 
  5. $matches = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bb_decodeit($matches); 
  9.  

Defined (1)

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

/bp-forums/bbpress/bb-includes/functions.bb-formatting.php  
  1. function bb_decodeit( $matches ) { 
  2. $text = $matches[2]; 
  3. $trans_table = array_flip(get_html_translation_table(HTML_ENTITIES)); 
  4. $text = strtr($text, $trans_table); 
  5. $text = str_replace('<br />', '<coded_br />', $text); 
  6. $text = str_replace('<p>', '<coded_p>', $text); 
  7. $text = str_replace('</p>', '</coded_p>', $text); 
  8. $text = str_replace(array('&', '&'), '&', $text); 
  9. $text = str_replace(''', "'", $text); 
  10. if ( '<pre><code>' == $matches[1] ) 
  11. $text = "\n$text\n"; 
  12. return "`$text`";