/**
* Filters the categories before building the category list.
*
* @since 4.4.0
*
* @param WP_Term[] $categories An array of the post's categories.
* @param int|false $post_id ID of the post to retrieve categories for.
* When `false`, defaults to the current post in the loop.
*/
$categories =
apply_filters( 'the_category_list',
get_the_category( $post_id ),
$post_id );
if ( empty( $categories ) ) { /** This filter is documented in wp-includes/category-template.php */
return apply_filters( 'the_category',
__( 'Uncategorized'
),
$separator,
$parents );
} $rel =
( is_object( $wp_rewrite ) &&
$wp_rewrite->
using_permalinks() ) ? 'rel="category tag"' : 'rel="category"';
$thelist = '';
if ( '' ===
$separator ) { $thelist .= '<ul class="post-categories">';