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?