Thanks for the note @salthareket — try {{ function('comment_form') }} which will directly call WP’s comment_form function
J
(@carlosreynolds)
Hey Jared,
Thanks for posting a workaround, I’m getting the same error.
Any chance you can help me with this coding?
$context['comment_form'] = TimberHelper::get_comment_form();
Your help would be much appreciated.
Cheers
James
Hello guys,
got same problem after updating on few sites. Checked timber-helper from previous version and found that get_comment_form will be deprecated. “0.21.8 use {{ function('comment_form') }} instead”.
So i stopped with two solutions:
1. For comment form without arguments just use {{ function('comment_form') }} in your template.
2. For arguments i used $context['comment_form'] = TimberHelper::ob_function('comment_form', array( $args, null ) );
I wrapped in ob_function because if i use directly like in timber-starter-theme $context['comment_form'] = comment_form(); i got messy code with comment form on page top.
Hope it will help someone.
Regards,
Max
@carlosreynolds @oxyplay: The new version of Timber (1.0.2) restores the old comment_form function and adds a new {{ post.comment_form }} method
J
(@carlosreynolds)
Thanks @jarednova. I’ve kept my initial coding and updated to 1.0.3 and it seems to be working fine.