Quote $id in get_the_category() db query. Patch from MCincubus for bug 0000191.
git-svn-id: https://develop.svn.wordpress.org/trunk@1486 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
cd714acb4e
commit
685eeb94f9
@ -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
Block a user