bbp_decode_callback( array $matches = array() )
Callback to decode the tags in topic or reply content
Description
Parameters
- $matches
-
(Optional)
Default value: array()
Return
(string)
Source
File: bp-forums/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
| Version | Description |
|---|---|
| bbPress (r4641) | Introduced. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.