Return false if empty cat passed. Restores old behavior.

git-svn-id: http://svn.automattic.com/wordpress/trunk@16478 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2010-11-19 05:06:48 +00:00
parent 8cd425bf92
commit 7cb2ad6d3a
1 changed files with 3 additions and 0 deletions

View File

@ -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. * @return bool True if the current post is in any of the given categories.
*/ */
function in_category( $category, $post = null ) { function in_category( $category, $post = null ) {
if ( empty( $category ) )
return false;
return has_term( $category, 'category', $post ); return has_term( $category, 'category', $post );
} }