Skip to content

Commit

Permalink
Use default_category option instead of now defunct post_default_categ…
Browse files Browse the repository at this point in the history
…ory.

git-svn-id: https://develop.svn.wordpress.org/branches/1.5@2681 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
ryanboren committed Jun 30, 2005
1 parent d8b2ca9 commit b6a6483
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions wp-includes/functions-post.php
Expand Up @@ -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;
global $wpdb, $allowedtags;

// export array as variables
extract($postarr);
Expand All @@ -16,7 +16,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];
Expand Down Expand Up @@ -110,7 +110,7 @@ function wp_update_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_modified = current_time('mysql');
$post_modified_gmt = current_time('mysql', 1);
Expand Down Expand Up @@ -157,7 +157,7 @@ function wp_set_post_cats($blogid = '1', $post_ID = 0, $post_categories = array(
// If $post_categories isn't already an array, make it one:
if (!is_array($post_categories)) {
if (!$post_categories) {
$post_categories = 1;
$post_categories = get_option('default_category');
}
$post_categories = array($post_categories);
}
Expand Down

0 comments on commit b6a6483

Please sign in to comment.