XF 2.2 return thread URL by ID - opposite of getThreadFromUrl()

Chris D

XenForo developer
Staff member
Use the ID to get the thread record and pass that into the link builder, e.g.

PHP:
$thread = \XF::em()->find('XF:Thread', $id);
if ($thread)
{
    $url = \XF::app()->buildLink('threads', $thread);
}
 
Top