Trying to enable crossposting from xmlrpc post client  


bdebruin
Posts: 14
Customer
(@bdebruin)
Member
Joined: 7 months ago

Hi team,

I am writing some php functions to automatically crosspost to wpForo if a Wordpress post is published. I got this working for Wordpress posts created by WPUF and the next step is to enable this for post created through xmlrpc.

With logging I compared the differences and I got stuck on this piece of code inside wpForoCrossPosting.php

    private function addTopic($post, $forumID) {
$args = $this->getRequestData($forumID, $post);
write_log($args);
if ($args) {
$newTopicID = WPF()->topic->add($args);
write_log($newTopicID);
if ($newTopicID) {
update_post_meta($post->ID, wpForoCrossPostingOptions::META_POST_FORUM_ID, $forumID);
update_post_meta($post->ID, wpForoCrossPostingOptions::META_POST_TOPIC_ID, $newTopicID);
}
}
}

When triggerd by a WPUF created post $args is and the wpForo crosspost is created.

(
[forumid] => 5
[title] => wpuf created post
[userid] => 1
[body] => wpuf created post
[created] => 2019-07-09 20:53:32
[slug] => wpuf-created-post
)

When triggerd by a xmlrpc created post $args is (below) and the wpForo crosspost is not created.

(
[forumid] => 5
[title] => Xmlrpc created post
[userid] => 1
[body] => xmlrpc created post
[created] => 2019-07-09 20:54:29
[slug] => xmlrpc-created-post
)

Any chance you can shine a light on this?

3 Replies
Astghik
Posts: 2886
Admin
(@astghik)
Support Team
Joined: 2 years ago

Hi @bdebruin,

I'm going to ask this question to add-on developers. Please wait for a bit. I'll update the topic once I get a response from them. 

Reply
2 Replies
bdebruin
Customer
(@bdebruin)
Joined: 7 months ago

Member
Posts: 14

@astghik

Many thanks, I am looking for some kind of insights how the Topic is created from within crossposting plugin. From what I see there is a little more to it than just the call mentioned with the correct args. Maybe the addTopic function is using information stored in globals variables?

Reply
Astghik
Admin
(@astghik)
Joined: 2 years ago

Support Team
Posts: 2886

@bdebruin,

Please find the add method in the /wp-content/plugins/wpforo/wpf-includes/class-topics.php file and check the parameters that should be passed by your plugin. 

Reply
Share: