Changeset 4119 for trunk/wp-includes/post.php
- Timestamp:
- 08/27/2006 07:26:03 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/post.php
r4117 r4119 760 760 global $wpdb; 761 761 // If $post_categories isn't already an array, make it one: 762 if (!is_array($post_categories) || 0 == count($post_categories) )762 if (!is_array($post_categories) || 0 == count($post_categories) || empty($post_categories)) 763 763 $post_categories = array(get_option('default_category')); 764 764 … … 795 795 if ($add_cats) { 796 796 foreach ($add_cats as $new_cat) { 797 $wpdb->query(" 798 INSERT INTO $wpdb->post2cat (post_id, category_id) 799 VALUES ($post_ID, $new_cat)"); 797 if ( !empty($new_cat) ) 798 $wpdb->query(" 799 INSERT INTO $wpdb->post2cat (post_id, category_id) 800 VALUES ($post_ID, $new_cat)"); 800 801 } 801 802 }
Note: See TracChangeset
for help on using the changeset viewer.