Notifications
Clear all

Pls add wpforo 1st post WP post edit sync

5 Posts
2 Users
1 Reactions
998 Views
Posts: 25
Topic starter
(@nando4)
Eminent Member
Joined: 7 years ago

wpforo replies (not first post) are synched with WP comments and vice-versa.

However, editting the wpforo 1st post doesn't see it synch with the wp post, though editting the wp post does synch with the wpforo 1st post.

Pls enhance this plugin with wpforo 1st post <-> wp post edit synch.

Thank you

4 Replies
Elvina
Posts: 1403
(@elvina)
Support
Joined: 5 years ago

Hi @nando4,

This couldn't be implemented for security reason as the only authors, admins (high-level users) have permission to create/edit WordPress posts.

 

Reply
2 Replies
(@nando4)
Joined: 7 years ago

Eminent Member
Posts: 25

@elvina, the cross posted wpforo post is by the same author as the WP post. So why not allow it to be editted by that user so that it is synced back to the WP Post? 

Reply
Elvina
(@elvina)
Joined: 5 years ago

Support
Posts: 1403

@nando4,

We will take it into consideration and if it's possible we will try to implement, in the near future releases(no ETA).

 

 

Reply
Posts: 25
Topic starter
(@nando4)
Eminent Member
Joined: 7 years ago

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);
}
}
}
Reply
Share:
Scroll to top