3.7 regression from [25119]: Have in_category() return false when the first argument is empty.

Merges [25923] to the 3.7 branch.

props ericlewis.
fixes #25706.

Built from https://develop.svn.wordpress.org/branches/3.7@25924


git-svn-id: http://core.svn.wordpress.org/branches/3.7@25883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2013-10-26 02:55:08 +00:00
parent 63b0a09a2f
commit 45cb40226f
1 changed files with 3 additions and 0 deletions

View File

@ -232,6 +232,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_category( $category, $post );
}