Use default_category option if not cat specified.

git-svn-id: https://develop.svn.wordpress.org/trunk@2648 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2005-06-18 19:17:55 +00:00
parent 15dc0c3307
commit f2d1f8460f
1 changed files with 2 additions and 2 deletions

View File

@ -6,7 +6,7 @@
* generic function for inserting data into the posts table.
*/
function wp_insert_post($postarr = array()) {
global $wpdb, $post_default_category, $allowedtags, $user_ID;
global $wpdb, $allowedtags, $user_ID;
// export array as variables
extract($postarr);
@ -21,7 +21,7 @@ function wp_insert_post($postarr = array()) {
// Make sure we set a valid category
if (0 == count($post_category) || !is_array($post_category)) {
$post_category = array($post_default_category);
$post_category = array(get_option('default_category'));
}
$post_cat = $post_category[0];