mirror of
https://github.com/WordPress/WordPress.git
synced 2024-09-30 08:08:10 +02:00
Update in_category to use the new object_term_cache, it wasn't so much with the working before.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5693 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
6dca00cae6
commit
81dd1f1737
@ -155,10 +155,10 @@ function get_the_category_list($separator = '', $parents='') {
|
|||||||
return apply_filters('the_category', $thelist, $separator, $parents);
|
return apply_filters('the_category', $thelist, $separator, $parents);
|
||||||
}
|
}
|
||||||
|
|
||||||
function in_category($category) { // Check if the current post is in the given category
|
function in_category( $category ) { // Check if the current post is in the given category
|
||||||
global $category_cache, $post, $blog_id;
|
global $object_term_cache, $post, $blog_id;
|
||||||
|
|
||||||
if ( isset( $category_cache[$blog_id][$post->ID][$category] ) )
|
if ( isset( $object_term_cache[$blog_id][$post->ID]['category'][$category] ) )
|
||||||
return true;
|
return true;
|
||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user