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
This commit is contained in:
parent
d8e2eb8943
commit
a49867ae66
@ -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 );
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user