Log in

View Full Version : change bbcode to standards compliant


dethfire
03-27-2013, 05:22 AM
I want to change the B I U etc bbcode to CSS. Anyone do this?

kh99
03-31-2013, 08:15 PM
If you create a plugin using hook bbcode_fetch_tags, you can change the html for those bbcodes. The replacement should be html with the text represented by %1$s. So you probably want something like:

$tag_list['no_option']['b']['html'] = '<span class="bold">%1$s</span>';
$tag_list['no_option']['i']['html'] = '<span class="italic">%1$s</span>';
$tag_list['no_option']['u']['html'] = '<span class="underline">%1$s</span>';

dethfire
04-13-2013, 02:47 AM
Thanks! Is this hard coded somewhere? I wouldn't mind changing a file since there will be no updates to 3.8

kh99
04-13-2013, 11:39 AM
Thanks! Is this hard coded somewhere? I wouldn't mind changing a file since there will be no updates to 3.8

Do you mean you'd rather change a file than use a plugin? If so, you can make changes in includes/class_bbcode.php, function fetch_tag_list() around line 2232.