Use default category if none specified.

git-svn-id: http://svn.automattic.com/wordpress/trunk@696 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
saxmatt 2004-01-03 00:37:24 +00:00
parent c33b0c8d82
commit 2be85a4a61

View File

@ -135,7 +135,7 @@ switch($action) {
// Insert categories
// Check to make sure there is a category, if not just set it to some default
if (!$post_categories) $post_categories = $wpdb->get_var("SELECT cat_ID FROM $tablecategories LIMIT 1");
if (!$post_categories) $post_categories[] = 1;
foreach ($post_categories as $post_category) {
// Double check it's not there already
$exists = $wpdb->get_row("SELECT * FROM $tablepost2cat WHERE post_id = $post_ID AND category_id = $post_category");