From 83bca28d72fc79909bdc6d335bee2917ffbb1e30 Mon Sep 17 00:00:00 2001 From: Matt Mullenweg Date: Mon, 28 Nov 2005 09:44:56 +0000 Subject: [PATCH] No need to do those big fancy joins. git-svn-id: https://develop.svn.wordpress.org/trunk@3220 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/functions.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index a79471a612..e5fb89c9c4 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -1277,15 +1277,13 @@ function update_post_category_cache($post_ids) { if ( is_array($post_ids) ) $post_ids = implode(',', $post_ids); - $dogs = $wpdb->get_results("SELECT DISTINCT - post_id, cat_ID FROM $wpdb->categories, $wpdb->post2cat - WHERE category_id = cat_ID AND post_id IN ($post_ids)"); + $dogs = $wpdb->get_results("SELECT post_id, category_id FROM $wpdb->post2cat WHERE post_id IN ($post_ids)"); if ( empty($dogs) ) return; foreach ($dogs as $catt) - $category_cache[$catt->post_id][$catt->cat_ID] = &get_category($catt->cat_ID); + $category_cache[$catt->post_id][$catt->category_id] = &get_category($catt->category_id); } function update_post_caches(&$posts) {