Changeset 2682
- Timestamp:
- 07/02/2005 05:20:14 PM (20 years ago)
- Location:
- tags/1.5.1.3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
tags/1.5.1.3/wp-includes/functions-post.php
r2667 r2682 7 7 */ 8 8 function wp_insert_post($postarr = array()) { 9 global $wpdb, $ post_default_category, $allowedtags;9 global $wpdb, $allowedtags; 10 10 11 11 // export array as variables … … 17 17 // Make sure we set a valid category 18 18 if (0 == count($post_category) || !is_array($post_category)) { 19 $post_category = array( $post_default_category);19 $post_category = array(get_option('default_category')); 20 20 } 21 21 … … 111 111 // Make sure we set a valid category 112 112 if ( 0 == count($post_category) || !is_array($post_category) ) 113 $post_category = array( $post_default_category);113 $post_category = array(get_option('default_category')); 114 114 115 115 $post_modified = current_time('mysql'); … … 158 158 if (!is_array($post_categories)) { 159 159 if (!$post_categories) { 160 $post_categories = 1;160 $post_categories = get_option('default_category'); 161 161 } 162 162 $post_categories = array($post_categories); -
tags/1.5.1.3/xmlrpc.php
r2673 r2682 11 11 12 12 $post_default_title = ""; // posts submitted via the xmlrpc interface get that title 13 $post_default_category = 1; // posts submitted via the xmlrpc interface go into that category14 13 15 14 $xmlrpc_logging = 0; … … 564 563 $post_category[] = get_cat_ID($cat); 565 564 } 566 } else {567 $post_category[] = $post_default_category;568 565 } else if ( !empty($catnames) ) { 566 $post_category = array(get_cat_ID($catnames)); 567 } 569 568 570 569 // We've got all the data -- post it: … … 615 614 $post_content = apply_filters( 'content_save_pre', $content_struct['description'] ); 616 615 $catnames = $content_struct['categories']; 616 617 $post_category = array(); 617 618 618 619 if (is_array($catnames)) { … … 620 621 $post_category[] = get_cat_ID($cat); 621 622 } 622 } else {623 $post_category[] = $post_default_category;624 623 } else if ( !empty($catnames) ) { 624 $post_category = array(get_cat_ID($catnames)); 625 } 625 626 626 627 $post_excerpt = $content_struct['mt_excerpt']; … … 830 831 // http://mycvs.org/archives/2004/06/30/file-upload-to-wordpress-in-ecto/ 831 832 832 $this->escape($args);833 834 $blog_ID = $ args[0];835 $user_login = $ args[1];836 $user_pass = $args[2];833 global $wpdb; 834 835 $blog_ID = $wpdb->escape($args[0]); 836 $user_login = $wpdb->escape($args[1]); 837 $user_pass = $wpdb->escape($args[2]); 837 838 $data = $args[3]; 838 839 … … 1200 1201 logIO("O","(PB) URI='$pagelinkedto' ID='$post_ID' Found='$way'"); 1201 1202 1202 $post = $wpdb->get_row("SELECT post_author FROM $wpdb->posts WHERE ID = '$post_ID'");1203 $post = get_post($post_ID); 1203 1204 1204 1205 if ( !$post ) // Post_ID not found
Note: See TracChangeset
for help on using the changeset viewer.