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

Adds unit tests.

props ericlewis.
fixes #25706 for trunk.

Built from https://develop.svn.wordpress.org/trunk@25923


git-svn-id: http://core.svn.wordpress.org/trunk@25882 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2013-10-26 02:54:10 +00:00
parent dfe0e26154
commit 73ee71a239
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 );
}