Return false if empty cat passed. Restores old behavior.
git-svn-id: https://develop.svn.wordpress.org/trunk@16478 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
94737b9d3b
commit
0d0edecd79
@ -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 );
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user