bbp_code_trick( string $content = '' )

Filter the topic or reply content and output code and pre tags


Description Description


Parameters Parameters

$content

(Optional) Topic and reply content

Default value: ''


Top ↑

Return Return

(string) Partially encoded content


Top ↑

Source Source

File: includes/common/formatting.php

function bbp_code_trick( $content = '' ) {
	$content = str_replace( array( "\r\n", "\r" ), "\n", $content );
	$content = preg_replace_callback( "|(`)(.*?)`|",      'bbp_encode_callback', $content );
	$content = preg_replace_callback( "!(^|\n)`(.*?)`!s", 'bbp_encode_callback', $content );

	return $content;
}

Top ↑

Changelog Changelog

Changelog
Version Description
2.3.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.