Make a Code Event Listener for event location load_class and also for load_class_bb_code. Your listeners should have a Callback Execution Order of 10001, class name MyAddon_MyListenerClass (library/MyAddon/MyListenerClass.php), method load_class, and it should look like:
Code:
class MyAddon_MyListenerClass
{
public static function load_class($class, &$extend)
{
if ($class == 'XenForo_BbCode_Parser')
{
$extend[] = 'MyAddon_MyClass';
}
}
}
In this example, your custom BB-Code class would be stored in library/MyAddon/MyClass.php, and it should look like:
Code:
class MyAddon_MyClass extends XFCP_MyAddon_MyClass
{
public function vwGetWikiTagDefinitions()
{
$tags = parent::vwGetWikiTagDefinitions();
$tag = vw_Hard_Core::model('Tag')->get_tag_name('vw_template_tag');
if (isset($tags["$tag"]))
{
$tags["$tag"]['trimLeadingLinesAfter'] = 1;
}
return $tag;
}
}
Bookmarks