No need to do those big fancy joins.

git-svn-id: http://svn.automattic.com/wordpress/trunk@3220 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
matt 2005-11-28 09:44:56 +00:00
parent 7c4d4cbec8
commit 2235469b60
1 changed files with 2 additions and 4 deletions

View File

@ -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) {