Quote $id in get_the_category() db query. Patch from MCincubus for bug 0000191.
git-svn-id: http://svn.automattic.com/wordpress/trunk@1486 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
2734dca687
commit
96db009381
|
@ -13,7 +13,7 @@ function get_the_category($id = false) {
|
|||
$categories = $wpdb->get_results("
|
||||
SELECT category_id, cat_name, category_nicename, category_description, category_parent
|
||||
FROM $wpdb->categories, $wpdb->post2cat
|
||||
WHERE $wpdb->post2cat.category_id = cat_ID AND $wpdb->post2cat.post_id = $id
|
||||
WHERE $wpdb->post2cat.category_id = cat_ID AND $wpdb->post2cat.post_id = '$id'
|
||||
");
|
||||
|
||||
return $categories;
|
||||
|
|
Loading…
Reference in New Issue