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
This commit is contained in:
nacin 2012-04-27 19:23:57 +00:00
parent b82ddbd98b
commit dd8b4816fb
1 changed files with 2 additions and 2 deletions

View File

@ -153,10 +153,10 @@ function get_the_category_by_ID( $cat_ID ) {
*/ */
function get_the_category_list( $separator = '', $parents='', $post_id = false ) { function get_the_category_list( $separator = '', $parents='', $post_id = false ) {
global $wp_rewrite; 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 ); return apply_filters( 'the_category', '', $separator, $parents );
$categories = get_the_category( $post_id );
if ( empty( $categories ) ) if ( empty( $categories ) )
return apply_filters( 'the_category', __( 'Uncategorized' ), $separator, $parents ); return apply_filters( 'the_category', __( 'Uncategorized' ), $separator, $parents );