I'm trying to create a thread with a poll.
I'm able to create the thread using
But not sure how to create the poll. I see that $creator = \XF::service('XF:Thread\Creator', $forum); has a $creator->setPollCreator(); but unsure how to use that.
Any tips?
I'm able to create the thread using
PHP:
$thread = \XF::asVisitor($User, function() use ($forum, $title, $message)
{
$creator = \XF::service('XF:Thread\Creator', $forum);
$creator->setContent($title, $message);
$creator->setPrefix($forum['default_prefix_id']);
$creator->setIsAutomated();
return $creator->save();
});
But not sure how to create the poll. I see that $creator = \XF::service('XF:Thread\Creator', $forum); has a $creator->setPollCreator(); but unsure how to use that.
Any tips?