From 65d047cde2bd7a4b66be46a6eaf03eed189317b5 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sat, 24 Aug 2013 22:53:39 +0000 Subject: [PATCH] Make in_category() an alias of has_category(). fixes #16718. git-svn-id: https://develop.svn.wordpress.org/trunk@25119 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/category-template.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/wp-includes/category-template.php b/src/wp-includes/category-template.php index 96a61cf35e..ca58200d61 100644 --- a/src/wp-includes/category-template.php +++ b/src/wp-includes/category-template.php @@ -225,16 +225,14 @@ function get_the_category_list( $separator = '', $parents='', $post_id = false ) * As of 2.7, the function can be used anywhere if it is provided a post ID or post object. * * @since 1.2.0 + * @uses has_category() * * @param int|string|array $category Category ID, name or slug, or array of said. * @param int|object $post Optional. Post to check instead of the current post. (since 2.7.0) * @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 ); + return has_category( $category, $post ); } /**