Use default category if none specified.
git-svn-id: https://develop.svn.wordpress.org/trunk@696 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
091d364dc6
commit
4bdeac4763
|
@ -135,7 +135,7 @@ switch($action) {
|
||||||
|
|
||||||
// Insert categories
|
// Insert categories
|
||||||
// Check to make sure there is a category, if not just set it to some default
|
// 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) {
|
foreach ($post_categories as $post_category) {
|
||||||
// Double check it's not there already
|
// Double check it's not there already
|
||||||
$exists = $wpdb->get_row("SELECT * FROM $tablepost2cat WHERE post_id = $post_ID AND category_id = $post_category");
|
$exists = $wpdb->get_row("SELECT * FROM $tablepost2cat WHERE post_id = $post_ID AND category_id = $post_category");
|
||||||
|
|
Loading…
Reference in New Issue