Make WordPress Core

Changeset 4833


Ignore:
Timestamp:
01/30/2007 03:09:58 AM (19 years ago)
Author:
ryan
Message:

More XML-RPC API enhancements from Joseph Scott.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/xmlrpc.php

    r4814 r4833  
    10761076        }
    10771077
    1078         // Only ste the menu_order if it was given.
     1078        // Only set the menu_order if it was given.
    10791079        if(!empty($content_struct["wp_page_order"])) {
    10801080            $menu_order = $content_struct["wp_page_order"];
     1081        }
     1082
     1083        // Only set the post_author if one is set.
     1084        if(!empty($content_struct["wp_author"])) {
     1085            $post_author = $content_struct["wp_author"];
    10811086        }
    10821087
     
    11231128
    11241129      // We've got all the data -- post it:
    1125       $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_name', 'post_password', 'post_parent', 'menu_order');
     1130      $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_name', 'post_password', 'post_parent', 'menu_order', 'post_author');
    11261131
    11271132      $result = wp_update_post($newpost);
     
    12341239            $link = post_permalink($entry['ID']);
    12351240
     1241            // Get the post author info.
     1242            $author = get_userdata($entry['ID']);
     1243
    12361244            $allow_comments = ('open' == $entry['comment_status']) ? 1 : 0;
    12371245            $allow_pings = ('open' == $entry['ping_status']) ? 1 : 0;
     
    12511259                'mt_text_more' => $post['extended'],
    12521260                'mt_allow_comments' => $allow_comments,
    1253                 'mt_allow_pings' => $allow_pings
     1261                'mt_allow_pings' => $allow_pings,
     1262                'wp_slug' => $entry['post_name'],
     1263                'wp_password' => $entry['post_password'],
     1264                'wp_author' => $author->user_nicename,
     1265                'wp_author_username' => $author->user_login
    12541266            );
    12551267
Note: See TracChangeset for help on using the changeset viewer.