From a49867ae660638ab2742a5db7fa91613ec95458a Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Fri, 27 Apr 2012 19:23:57 +0000 Subject: [PATCH] Don't call get_the_category() in get_the_category_list() unless the post type supports categories. props niallkennedy. fixes #19671. git-svn-id: https://develop.svn.wordpress.org/trunk@20622 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/category-template.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/category-template.php b/wp-includes/category-template.php index b71f791178..7519f13f7e 100644 --- a/wp-includes/category-template.php +++ b/wp-includes/category-template.php @@ -153,10 +153,10 @@ function get_the_category_by_ID( $cat_ID ) { */ function get_the_category_list( $separator = '', $parents='', $post_id = false ) { global $wp_rewrite; - $categories = get_the_category( $post_id ); - if ( !is_object_in_taxonomy( get_post_type( $post_id ), 'category' ) ) + if ( ! is_object_in_taxonomy( get_post_type( $post_id ), 'category' ) ) return apply_filters( 'the_category', '', $separator, $parents ); + $categories = get_the_category( $post_id ); if ( empty( $categories ) ) return apply_filters( 'the_category', __( 'Uncategorized' ), $separator, $parents );