bbp_decode_callback( array $matches = array() )
Callback to decode the tags in topic or reply content
Description Description
Parameters Parameters
- $matches
-
(Optional)
Default value: array()
Return Return
(string)
Source Source
File: includes/common/formatting.php
function bbp_decode_callback( $matches = array() ) {
// Setup variables
$trans_table = array_flip( get_html_translation_table( HTML_ENTITIES ) );
$amps = array( '&','&', '&' );
$single = array( ''',''' );
$content = $matches[2];
$content = strtr( $content, $trans_table );
// Do the do
$content = str_replace( '<br />', '<coded_br />', $content );
$content = str_replace( '<p>', '<coded_p>', $content );
$content = str_replace( '</p>', '</coded_p>', $content );
$content = str_replace( $amps, '&', $content );
$content = str_replace( $single, "'", $content );
// Return content wrapped in code tags
return '`' . $content . '`';
}
Changelog Changelog
| Version | Description |
|---|---|
| 2.3.0 | Introduced. |