• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.3 Limit the font size both in the editor and by bbcode


Formerly Super120
Hi guys I want to limit the font size in the font drop down menu at the editor and also limit the parsing of the size bbcode up to for example 5 so if size=10 the size used should be 5. Is this possible?

Jake Bunce

XenForo moderator
Staff member

Search for "getTextSize". That function validates the sizes. It can be edited to eliminate some sizes.

You will see it only allows up to 7 by default:

				switch ($inputSize)
					case 1: $size = '9px'; break;
					case 2: $size = '10px'; break;
					case 3: $size = '12px'; break;
					case 4: $size = '15px'; break;
					case 5: $size = '18px'; break;
					case 6: $size = '22px'; break;

					case 7:
						$size = '26px';


Formerly Super120
Thanks, it works! Now how I can remove the options from 1 to 7 that appear when clicking on the "Font Size" control on the editor? I just want three options: 1, 2 and 3 for consistency with the changes I made in Base.php