Trim text to 500


Well-known member
I'd like to modify the code so that the content is wholeWordTrim($content, 500) as it is in the resource manager:

$body = '[quote]' . XenForo_Helper_String::autoLinkBbCode(XenForo_Html_Renderer_BbCode::renderFromHtml(nl2br($content))) . "[/quote]";

Could the content be trimmed prior to the above line ? I tried something like that before this line and it failed to write the thread.


Update: In case someone trips over this post. The answer was too obvious. I was missing the XenForo_Helper_String ...

Here is the working code:

$body = XenForo_Helper_String::wholeWordTrim($body, 500);