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:
parent
dfe0e26154
commit
73ee71a239
|
@ -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 );
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue