From dd8b4816fbcaa683ccd9b1971a92606d08f2621e Mon Sep 17 00:00:00 2001 From: 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: http://svn.automattic.com/wordpress/trunk@20622 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- 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 );