XenForo thread prefixes were challenging to add to a widget. This is because a var_dump of the $prefixTitle was returning thread_prefix_.
Rich (BB code):
object(XenForo_Phrase)[255]
protected '_phraseName' => string 'thread_prefix_1' (length=15)
protected '_params' =>
array (size=0)
empty
protected '_insertParamsEscaped' => boolean true
protected '_phraseNameOnInvalid' => boolean true
It turns out the code was far easier than my initial twisted attempts.
PHP:
/** @var XenForo_Model_ThreadPrefix $prefixModel */
$prefixModel = XenForo_Model::create( 'XenForo_Model_ThreadPrefix' );
$thread_prefix = $prefixModel->getPrefixById($prefix_id);
$preparePrefix = $prefixModel->preparePrefix($thread_prefix);
$prefixTitle = $preparePrefix['title'];
echo $prefixTitle;
Next, an option to show prefixes needs to be added and the option added in the proper widgets.