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
This commit is contained in:
ryan 2005-06-19 03:30:46 +00:00
parent 4cb88cef6e
commit de05283f30
1 changed files with 9 additions and 11 deletions

View File

@ -508,6 +508,8 @@ class wp_xmlrpc_server extends IXR_Server {
$post_content = $post_content . "\n<!--more-->\n" . $post_more; $post_content = $post_content . "\n<!--more-->\n" . $post_more;
} }
$to_ping = $content_struct['mt_tb_ping_urls'];
// Do some timestamp voodoo // Do some timestamp voodoo
$dateCreatedd = $content_struct['dateCreated']; $dateCreatedd = $content_struct['dateCreated'];
if (!empty($dateCreatedd)) { if (!empty($dateCreatedd)) {
@ -532,7 +534,7 @@ class wp_xmlrpc_server extends IXR_Server {
} }
// We've got all the data -- post it: // 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); $post_ID = wp_insert_post($postdata);
@ -542,9 +544,6 @@ class wp_xmlrpc_server extends IXR_Server {
logIO('O', "Posted ! ID: $post_ID"); 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); return strval($post_ID);
} }
@ -592,6 +591,8 @@ class wp_xmlrpc_server extends IXR_Server {
$post_content = $post_content . "\n<!--more-->\n" . $post_more; $post_content = $post_content . "\n<!--more-->\n" . $post_more;
} }
$to_ping = $content_struct['mt_tb_ping_urls'];
$comment_status = (empty($content_struct['mt_allow_comments'])) ? $comment_status = (empty($content_struct['mt_allow_comments'])) ?
get_settings('default_comment_status') get_settings('default_comment_status')
: $content_struct['mt_allow_comments']; : $content_struct['mt_allow_comments'];
@ -612,18 +613,15 @@ class wp_xmlrpc_server extends IXR_Server {
} }
// We've got all the data -- post it: // 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); $result = wp_update_post($newpost);
if (!$post_ID) { if (!$result) {
return new IXR_Error(500, 'Sorry, your entry could not be edited. Something wrong happened.'); return new IXR_Error(500, 'Sorry, your entry could not be edited. Something wrong happened.');
} }
logIO('O',"(MW) Edited ! ID: $post_ID"); 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; return true;
} }