Move Topic – Update Topic message
Good day everyone,
I’m currently working on a plugin that allow users to create events (Custom Post Type) in the site, those being displayed in a calendar.
When those Custom Post Types are created, I programmatically create a bbpress topic in a forum. Custom post title being the topic subject, custom post content being the content. That works marvelous.
Now, I would like to do 2 things and I’m not quite sure what function to use:
– When the custom post is edited, depending on a metadata value, I would like to move the topic from one forum to another. Creating the topic in one or the other forum works OK at creation time. I would like to move it when it is modified. I’m trying bbp_update_topic but it does not do anything.
– I would also like to keep the Custom Post and the topic in sync regarding the content. Post ID and Topic ID are both stored in Topic and post meta. I would like that whenever one of the two are modified (mainly for the content), the other is modified the same way.
So in summary, what is
– the best approach to programmatically move a topic from a forum to another.
– Programmatically change the content of a topic when it has already been created.
– How to catch the event of modifying a topic so I can modify the source post content.
- You must be logged in to reply to this topic.