Not planned BB Code context not always needed

Snog

Well-known member
To my knowledge, the context is not always needed for a BB Code, so I suggest this change...

Code:
public function fnBbCode($templater, &$escape, $bbCode, $context = null, $user = null, array $options = [], $type = 'html')
 
Upvote 0
This suggestion has been closed. Votes are no longer accepted.
I still disagree.

There might be Add-ons dealing with BB code parsing that rely on information about what is being parsed in order to properly support your Code/Add-on, so you should not leave them in the dark - do provide the information what is being parsed.
 
It's a required argument in all cases so, indeed, it's not really designed to be optional. It should be provided even if it's just an arbitrary string that identifies its purpose or the add-on that calls it.
 
It's a required argument in all cases so, indeed, it's not really designed to be optional. It should be provided even if it's just an arbitrary string that identifies its purpose or the add-on that calls it.

That's my point. An arbitrary string really doesn't do anything. But, I'll abide by it.

Heck, even though I don't see why it's needed, I'll take it all the way {{ bb_code($myarray.field, 'mytype', $xf.visitor) }}
 
Last edited:
Back
Top Bottom