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

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 Bottom