Skip to content

Commit

Permalink
Attempt to fix extra default category bug.
Browse files Browse the repository at this point in the history
git-svn-id: https://develop.svn.wordpress.org/branches/1.5@2678 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
ryanboren committed Jun 30, 2005
1 parent 63aa670 commit 49efa04
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions xmlrpc.php
Expand Up @@ -10,7 +10,6 @@
// error_reporting(0);

$post_default_title = ""; // posts submitted via the xmlrpc interface get that title
$post_default_category = 1; // posts submitted via the xmlrpc interface go into that category

$xmlrpc_logging = 0;

Expand Down Expand Up @@ -563,9 +562,9 @@ function mw_newPost($args) {
foreach ($catnames as $cat) {
$post_category[] = get_cat_ID($cat);
}
} else {
$post_category[] = $post_default_category;
}
} else if ( !empty($catnames) ) {
$post_category = array(get_cat_ID($catnames));
}

// 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', 'to_ping');
Expand Down Expand Up @@ -614,14 +613,16 @@ function mw_editPost($args) {
$post_title = $content_struct['title'];
$post_content = apply_filters( 'content_save_pre', $content_struct['description'] );
$catnames = $content_struct['categories'];

$post_category = array();

if (is_array($catnames)) {
foreach ($catnames as $cat) {
$post_category[] = get_cat_ID($cat);
}
} else {
$post_category[] = $post_default_category;
}
} else if ( !empty($catnames) ) {
$post_category = array(get_cat_ID($catnames));
}

$post_excerpt = $content_struct['mt_excerpt'];
$post_more = $content_struct['mt_text_more'];
Expand Down Expand Up @@ -830,7 +831,7 @@ function mw_newMediaObject($args) {
// http://mycvs.org/archives/2004/06/30/file-upload-to-wordpress-in-ecto/

global $wpdb;

$blog_ID = $wpdb->escape($args[0]);
$user_login = $wpdb->escape($args[1]);
$user_pass = $wpdb->escape($args[2]);
Expand Down

0 comments on commit 49efa04

Please sign in to comment.