$category_object =
apply_filters( 'post_link_category',
$cats[0
],
$cats,
$post );
$category_object =
get_term( $category_object, 'category'
);
$category =
$category_object->slug;
if ( $category_object->parent
) { $category =
get_category_parents( $category_object->parent, false, '/', true
) .
$category;
} } /*
* Show default category in permalinks,
* without having to assign it explicitly.
*/
if ( empty( $category ) ) { $default_category =
get_term( get_option( 'default_category'
), 'category'
);
if ( $default_category && !
is_wp_error( $default_category ) ) { $category =
$default_category->slug;
} }