Search
Close
AI Search
Classic Search
 Search Phrase:
 Search Type:
Advanced search options
 Search in Forums:
 Search in date period:

 Sort Search Results by:

AI Assistant
Notifications
Clear all

Trying to enable crossposting from xmlrpc post client

4 Posts
2 Users
0 Reactions
2,355 Views
Posts: 26
Customer
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@bdebruin)
Member
Joined: 7 years ago
[#4188]

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: 6645
Admin
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@astgh)
Illustrious Member
Joined: 8 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: 7 years ago

Member
Posts: 26
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

@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: 8 years ago

Illustrious Member
Posts: 6645
Astghik
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

@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