bb_deslash

The BuddyPress bb deslash function.

Description

bb_deslash( $content ); 

Parameters (1)

0. $content
The content.

Usage

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

Defined (1)

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

/bp-forums/bbpress/bb-admin/includes/functions.bb-upgrade.php  
  1. function bb_deslash($content) { 
  2. // Note: \\\ inside a regex denotes a single backslash. 
  3.  
  4. // Replace one or more backslashes followed by a single quote with 
  5. // a single quote. 
  6. $content = preg_replace("/\\\+'/", "'", $content); 
  7.  
  8. // Replace one or more backslashes followed by a double quote with 
  9. // a double quote. 
  10. $content = preg_replace('/\\\+"/', '"', $content); 
  11.  
  12. // Replace one or more backslashes with one backslash. 
  13. $content = preg_replace("/\\\+/", "\\", $content); 
  14.  
  15. return $content;