WordPress.org

Make WordPress Core

Changeset 2653


Ignore:
Timestamp:
06/19/05 03:30:46 (10 years ago)
Author:
ryan
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/xmlrpc.php

    r2649 r2653  
    508508        $post_content = $post_content . "\n<!--more-->\n" . $post_more; 
    509509      } 
    510          
     510 
     511        $to_ping = $content_struct['mt_tb_ping_urls']; 
     512 
    511513      // Do some timestamp voodoo 
    512514      $dateCreatedd = $content_struct['dateCreated']; 
     
    533535         
    534536      // We've got all the data -- post it: 
    535       $postdata = compact('post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_title', 'post_category', 'post_status', 'post_excerpt', 'comment_status', 'ping_status'); 
     537      $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'); 
    536538 
    537539      $post_ID = wp_insert_post($postdata); 
     
    542544 
    543545      logIO('O', "Posted ! ID: $post_ID"); 
    544  
    545       // FIXME: do we pingback always? pingback($content, $post_ID); 
    546       trackback_url_list($content_struct['mt_tb_ping_urls'],$post_ID); 
    547546 
    548547      return strval($post_ID); 
     
    593592      } 
    594593 
     594        $to_ping = $content_struct['mt_tb_ping_urls']; 
     595 
    595596      $comment_status = (empty($content_struct['mt_allow_comments'])) ? 
    596597        get_settings('default_comment_status') 
     
    613614 
    614615      // We've got all the data -- post it: 
    615       $newpost = compact('ID', 'post_content', 'post_title', 'post_category', 'post_status', 'post_excerpt', 'comment_status', 'ping_status', 'post_date', 'post_date_gmt'); 
    616  
    617       $post_ID = wp_update_post($newpost); 
    618       if (!$post_ID) { 
     616      $newpost = compact('ID', 'post_content', 'post_title', 'post_category', 'post_status', 'post_excerpt', 'comment_status', 'ping_status', 'post_date', 'post_date_gmt', 'to_ping'); 
     617 
     618      $result = wp_update_post($newpost); 
     619      if (!$result) { 
    619620        return new IXR_Error(500, 'Sorry, your entry could not be edited. Something wrong happened.'); 
    620621      } 
    621622 
    622623      logIO('O',"(MW) Edited ! ID: $post_ID"); 
    623  
    624       // FIXME: do we pingback always? pingback($content, $post_ID); 
    625       trackback_url_list($content_struct['mt_tb_ping_urls'], $post_ID); 
    626624 
    627625      return true; 
Note: See TracChangeset for help on using the changeset viewer.