From 45cb40226f0649c1910828692a18a57ca31fe721 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Sat, 26 Oct 2013 02:55:08 +0000 Subject: [PATCH] 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 --- wp-includes/category-template.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wp-includes/category-template.php b/wp-includes/category-template.php index 27b8bf221f..57f7cb9ada 100644 --- a/wp-includes/category-template.php +++ b/wp-includes/category-template.php @@ -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 ); }