summaryrefslogtreecommitdiffstats
path: root/wp-includes/post.php
diff options
context:
space:
mode:
Diffstat (limited to 'wp-includes/post.php')
-rw-r--r--wp-includes/post.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/wp-includes/post.php b/wp-includes/post.php
index 810ad31..ab7c49c 100644
--- a/wp-includes/post.php
+++ b/wp-includes/post.php
@@ -804,10 +804,11 @@ function wp_set_post_categories($post_ID = 0, $post_categories = array()) {
if ($add_cats) {
foreach ($add_cats as $new_cat) {
+ $new_cat = (int) $new_cat;
if ( !empty($new_cat) )
$wpdb->query("
INSERT INTO $wpdb->post2cat (post_id, category_id)
- VALUES ($post_ID, $new_cat)");
+ VALUES ('$post_ID', '$new_cat')");
}
}