Notifications
Clear all

wpForo crossposting from WPUF and/of XMLRPC

3 Posts
2 Users
0 Reactions
1,979 Views
Posts: 26
Customer
Topic starter
(@bdebruin)
Member
Joined: 6 years ago

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:

  1. Wrote a snippet to hook the save_post_post event (attached in zip), it does a few things:
    1. When a WP blog post is trashed > disable the crossposting
    2. Use the first image as featured image (need because Word blog template does not support featured images) - not part of cross posting
    3. (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)
    4. Set the _wpforo_crossposting_forumid metadata key to the wpForo forum used for cross posting
  2. 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:

  1. Ensure the function is running correctly when _wpforo_crossposting_disabled metadata key is set (not only inline saves)
  2. Commented out all lines where _wpforo_crossposting_disabled metadata key is set in the plugin (except for the draft mode)
  3. Use SQL to close the wpForo topic for further editing when the user disables cross posting at a later stage
  4. Use SQL to make sure xmlrpc initiated wpForo topics are auto approved
  5. 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:

  1. Added a snippet filter (get_comments_link ) to change the comment link in the Wordpress post so it does point to the wpFooro topic
  2. Added a snippet hook to force update made by WPUF to save the post (triggering the save_post_post snippet)
  3. 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!

2 Replies
Astghik
Posts: 6152
Admin
(@astgh)
Illustrious Member
Joined: 7 years ago

Hi @bdebruin,

Thank you very much. We really appreciate you taking time and the information here.

Reply
Posts: 26
Customer
Topic starter
(@bdebruin)
Member
Joined: 6 years ago

UPDATE: with the 2.0.0 version of the crossposting plugin there is a new option to auto cross post based on the category, works awesome and made most of my changes redundant. Few issues remain, and I will open new topics for those

Reply
Share:
Scroll to top