Notifications
Clear all

Trying to enable crossposting from xmlrpc post client

4 Posts
2 Users
0 Reactions
1,472 Views
Posts: 26
Customer
Topic starter
(@bdebruin)
Member
Joined: 6 years 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: 6193
Admin
(@astgh)
Illustrious Member
Joined: 7 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
Customer
(@bdebruin)
Joined: 6 years ago

Member
Posts: 26

@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
(@astgh)
Joined: 7 years ago

Illustrious Member
Posts: 6193

@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:
Scroll to top