What I wanted to achieve is the ability to post from 2 different clients:
- WordPress User Frontend plugin (WPUF)
- Word blog template (based on XMLRPC protocol)
These do integrate with wpForo CrossPosting, so I made the following changes:
- Wrote a snippet to hook the save_post_post event (attached in zip), it does a few things:
- When a WP blog post is trashed > disable the crossposting
- Use the first image as featured image (need because Word blog template does not support featured images) - not part of cross posting
- (if not called from WPUF – see point 2) set the _wpforo_crossposting_disabled metadata key based on the category where Word saves the post (local category is always cross posted)
- Set the _wpforo_crossposting_forumid metadata key to the wpForo forum used for cross posting
- Created a post form in WPUF where the user controls cross posting through a yes/no radio button
So, from here on the end user has full control over cross posting. Either through the WPUF from (radio button) or through the Word blog template by choosing the post category.
The only changes I made are to wpForoCrossPosting.php (attached – see //EDIT). Changes are:
- Ensure the function is running correctly when _wpforo_crossposting_disabled metadata key is set (not only inline saves)
- Commented out all lines where _wpforo_crossposting_disabled metadata key is set in the plugin (except for the draft mode)
- Use SQL to close the wpForo topic for further editing when the user disables cross posting at a later stage
- Use SQL to make sure xmlrpc initiated wpForo topics are auto approved
- Use SQL to set wpForo topic to private when Wordpress blog post is saved as draft
I use the wpForo topic to comment on Wordpress blog posts. To further enhance things I created:
- Added a snippet filter (get_comments_link ) to change the comment link in the Wordpress post so it does point to the wpFooro topic
- Added a snippet hook to force update made by WPUF to save the post (triggering the save_post_post snippet)
- Added a snippet filter (_the_content) to hide the first image in the post (as this is now set as featured image)
Maybe you find here some suggestions to enhance wpForo crossposting.
You are welcome to www.excellent-bid.nl to see the commenting system working.
Have fun with it!