Creating a reply programmatically, it doesn't appear in the forums
I’m running the latest bbPress (2.5.4) and using Gravity Forms and the Custom Post Types addon to automatically create a bbPress reply when somebody submits a form. This is mostly working – the reply post is created in WordPress, I’m setting the _bbp_reply_to, _bbp_forum_id and _bbp_topic_id meta fields and it looks like it should in the backend.
However it doesn’t appear as a reply under the topic when you view the forums.
If I edit the newly-created reply in the WordPress admin backend (just hitting Update without making any changes) it does then appear.
I presume there’s some additional step required to update the forums metadata or relationships? I’ve tried using the “repair forum” tools after creating the reply, and calling bbp_update_reply from a hook on form submission, but neither seem to make the reply appear. The only thing which does is clicking “Update” in the backend.
Any pointers would be very much appreciated! It feels like I’m 90% there but am missing some vital “refresh” step at the end.
- You must be logged in to reply to this topic.