WordPress.org

Make WordPress Core

Ticket #19671: category-template.diff

File category-template.diff, 780 bytes (added by niallkennedy, 6 years ago)

attempt to fetch categories if categories applicable for post type

  • wp-includes/category-template.php

     
    153153 */
    154154function get_the_category_list( $separator = '', $parents='', $post_id = false ) {
    155155        global $wp_rewrite;
    156         $categories = get_the_category( $post_id );
    157         if ( !is_object_in_taxonomy( get_post_type( $post_id ), 'category' ) )
     156        if ( ! is_object_in_taxonomy( get_post_type( $post_id ), 'category' ) )
    158157                return apply_filters( 'the_category', '', $separator, $parents );
    159158
     159        $categories = get_the_category( $post_id );
    160160        if ( empty( $categories ) )
    161161                return apply_filters( 'the_category', __( 'Uncategorized' ), $separator, $parents );
    162162