Can you please help with the code additions to editForumPost for this "Pls add wpforo 1st post WP post edit sync " functionality?
For a forum-centric site, it avoids the need to use the wp editor to edit a post. Instead staying with the familiar forum post editting. Moderation code checks are not required since it's high level users with priviledges to edit wp_posts that can crosspost to begin with.
editForumPost function modification required:
1. Check if editting a wpforo crossposted first post
2. Sync up the wp_post with the editted wpforo_post, update the modified date timestamp
3. Purge the cache of the modified wp_post so a new page is created.
public function editForumPost($filteredArgs) {
if ($this->options->forumPostCrossingEdite) {
$blogPostID = $this->db->getBlogPostID($filteredArgs['topicid']);
$commentID = $this->db->getBlogCommentID($filteredArgs['postid']);
$actionSource = get_comment_meta($commentID, wpForoCrossPostingOptions::META_COMMENT_ACTION_SOURCE, true);
if ($blogPostID && $commentID && $actionSource != wpForoCrossPostingOptions::META_COMMENT_SOURCE_BLOG) {
update_comment_meta($commentID, wpForoCrossPostingOptions::META_COMMENT_ACTION_SOURCE, wpForoCrossPostingOptions::META_COMMENT_SOURCE_FORUM);
$commentArgs = array('comment_ID' => $commentID,
'comment_content' => $filteredArgs['body'],
'referrer' => wpForoCrossPostingOptions::META_COMMENT_SOURCE_FORUM);
wp_update_comment($commentArgs);
} else {
delete_comment_meta($commentID, wpForoCrossPostingOptions::META_COMMENT_ACTION_SOURCE);
}
}
}