From 0d0edecd792c9d0a32b6fc2add9e5ace918a2fc5 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Fri, 19 Nov 2010 05:06:48 +0000 Subject: [PATCH] Return false if empty cat passed. Restores old behavior. git-svn-id: https://develop.svn.wordpress.org/trunk@16478 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/category-template.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wp-includes/category-template.php b/wp-includes/category-template.php index 3a7d9ae72f..d491a6ceda 100644 --- a/wp-includes/category-template.php +++ b/wp-includes/category-template.php @@ -221,6 +221,9 @@ function get_the_category_list( $separator = '', $parents='', $post_id = false ) * @return bool True if the current post is in any of the given categories. */ function in_category( $category, $post = null ) { + if ( empty( $category ) ) + return false; + return has_term( $category, 'category', $post ); }