From de05283f305767f49fe0cce832c42a417061f68e Mon Sep 17 00:00:00 2001 From: ryan Date: Sun, 19 Jun 2005 03:30:46 +0000 Subject: [PATCH] Don't stomp post_ID in mw_editPost(). Pass TB URIs to wp_update_post() and wp_insert_post() instead of directly calling trackback_url_list(). #1452 git-svn-id: http://svn.automattic.com/wordpress/trunk@2653 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- xmlrpc.php | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/xmlrpc.php b/xmlrpc.php index 5f48532d9..785ee36df 100644 --- a/xmlrpc.php +++ b/xmlrpc.php @@ -507,7 +507,9 @@ class wp_xmlrpc_server extends IXR_Server { if ($post_more) { $post_content = $post_content . "\n\n" . $post_more; } - + + $to_ping = $content_struct['mt_tb_ping_urls']; + // Do some timestamp voodoo $dateCreatedd = $content_struct['dateCreated']; if (!empty($dateCreatedd)) { @@ -532,7 +534,7 @@ class wp_xmlrpc_server extends IXR_Server { } // We've got all the data -- post it: - $postdata = compact('post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_title', 'post_category', 'post_status', 'post_excerpt', 'comment_status', 'ping_status'); + $postdata = compact('post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_title', 'post_category', 'post_status', 'post_excerpt', 'comment_status', 'ping_status', 'to_ping'); $post_ID = wp_insert_post($postdata); @@ -542,9 +544,6 @@ class wp_xmlrpc_server extends IXR_Server { logIO('O', "Posted ! ID: $post_ID"); - // FIXME: do we pingback always? pingback($content, $post_ID); - trackback_url_list($content_struct['mt_tb_ping_urls'],$post_ID); - return strval($post_ID); } @@ -592,6 +591,8 @@ class wp_xmlrpc_server extends IXR_Server { $post_content = $post_content . "\n\n" . $post_more; } + $to_ping = $content_struct['mt_tb_ping_urls']; + $comment_status = (empty($content_struct['mt_allow_comments'])) ? get_settings('default_comment_status') : $content_struct['mt_allow_comments']; @@ -612,18 +613,15 @@ class wp_xmlrpc_server extends IXR_Server { } // We've got all the data -- post it: - $newpost = compact('ID', 'post_content', 'post_title', 'post_category', 'post_status', 'post_excerpt', 'comment_status', 'ping_status', 'post_date', 'post_date_gmt'); + $newpost = compact('ID', 'post_content', 'post_title', 'post_category', 'post_status', 'post_excerpt', 'comment_status', 'ping_status', 'post_date', 'post_date_gmt', 'to_ping'); - $post_ID = wp_update_post($newpost); - if (!$post_ID) { + $result = wp_update_post($newpost); + if (!$result) { return new IXR_Error(500, 'Sorry, your entry could not be edited. Something wrong happened.'); } logIO('O',"(MW) Edited ! ID: $post_ID"); - // FIXME: do we pingback always? pingback($content, $post_ID); - trackback_url_list($content_struct['mt_tb_ping_urls'], $post_ID); - return true; }