Trying to enable crossposting from xmlrpc post client  


bdebruin
Posts: 25
Customer
(@bdebruin)
Member
Joined: 1 year 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: 3480
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: 1 year ago

Member
Posts: 25

@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: 3480

@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:
Green
Default
Pear
Black Emo
{green}:grinning:
{green}:wink:
{green}:face:
{green}:inlove:
{green}:sweaty:
{green}:surprised:
{green}:lovekiss:
{green}:laugh:
{green}:formalsmile:
{green}:displeased:
{green}:cool:
{green}:resent:
{green}:nerd:
{green}:screaming:
{green}:amazed:
{green}:sad:
{green}:deceitful:
{green}:starryeyes:
{green}:evil:
{green}:shocked:
{green}:tears:
{green}:sulky:
{green}:smile:
{green}:vomited:
{green}:hi:
{green}:afraid:
{green}:crazy:
{green}:rabid:
{green}:fighting:
{green}:nonoise:
{green}:blushed:
{green}:idontknow:
{green}:scared:
{green}:razz:
{green}:kiss:
{green}:eat:
{green}:shutmouth:
{green}:gape:
{green}:suspicious:
{green}:laughingoutloud:
{green}:bruise:
{green}:crying:
{green}:pray:
{green}:serious:
{green}:excitement:
:)
:d
:wink:
:mrgreen:
:neutral:
:twisted:
:arrow:
:shock:
:???:
:cool:
:evil:
:oops:
:razz:
:roll:
:cry:
:eek:
:lol:
:mad:
:sad:
:!:
:?:
:idea:
:hmm:
:beg:
:whew:
:chuckle:
:silly:
:envy:
:shutmouth:
{pear}:happy:
{pear}:smile:
{pear}:laugh:
{pear}:laughingoutloud:
{pear}:crying:
{pear}:exhausted:
{pear}:nerd:
{pear}:surprised:
{pear}:veryhungry:
{pear}:wink:
{blackemo}:laughtertotears:
{blackemo}:gift:
{blackemo}:love:
{blackemo}:inlove:
{blackemo}:shamefaced:
{blackemo}:heart:
{blackemo}:crazy:
{blackemo}:anguished:
{blackemo}:bruise:
{blackemo}:easymoney:
{blackemo}:exhausted:
{blackemo}:vampire:
{blackemo}:shutmouth:
{blackemo}:wink:
{blackemo}:carnival:
{blackemo}:flowers:
{blackemo}:hotdrink:
{blackemo}:party: