Search Results for 'code'
-
Search Results
-
Topic: Delete via XML-RPC
I’ve been trying to delete a post via the XML-RPC API and just haven’t had any luck. I’m communicating fine with the API, sending and receiving works as expected, and the user has correct permissions. Everything else (as far as getting posts and making new posts) is also worked as expected. However, I’m always getting a return value of ‘0’ from the API, even though the post isn’t already deleted. I’m trying to accomplish this from Buddypress using bbPress Live. Any ideas on how to do this?
My request and response:
<?xml version="1.0"?>
<methodCall>
<methodName>bb.deletePost</methodName>
<params>
<param><value><array><data>
<value><string>forumadmin</string></value>
<value><string>******</string></value>
<value><struct>
<member><name>post_id</name><value><int>59</int></value></member>
</struct></value>
</data></array></value></param>
</params></methodCall>
<?xml version="1.0"?>
<methodResponse>
<params>
<param>
<value>
<int>0</int>
</value>
</param>
</params>
</methodResponse>Here’s the code I added to the bbPress_Live class
function delete_post( $post_id )
{
global $current_user;
if ( !$delete = $this->fetch->query( 'bb.deletePost', array( $post_id ), $current_user->user_login ) ) {
return false;
}
$key = md5( 'post_' . $post_id );
$this->cache_delete( $key );
return true;
}I have been working on a DEV site for several months now – integrated WP + BB.
I ran into some issues ‘upgrading’ bbPress from my legacy 0.9 install to the new 1.0.2 release, and the first ‘clean’ way I was able to get it done was to wipe out the bb tables & re-install from scratch.
I have now got the integration & theme down (thanks gerikg) on bbPress…but I would like to refresh with all my old posts, topics, forums, etc from the 0.9 days.
My question is approach: Is it better / easier for me to…
A) Rip out the ‘baked’ 1.0.2 install…go back to 0.9 (files and DB)…and try the upgrade again (assuming I figured out what went wrong…I think I can)
-or-
Attempt to ‘import’ my 0.9 backup (bb_ tables only) into my current 1.0.2 db?Naturally – I’m sure there are other things I’m not considering & maybe some other approaches too. Regardless – I appreciate the suggestions.
bforeste
