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:
parent
b82ddbd98b
commit
dd8b4816fb
|
@ -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