mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-01 03:04:34 +00:00
Do not show dummy default category output when calling the_category on a post_type that does not support the category taxonomy (like pages). Fix TwentyTen theme to not display wrapping text if there are no categories. fixes #10333
git-svn-id: https://develop.svn.wordpress.org/trunk@14660 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -175,6 +175,9 @@ 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' ) )
|
||||
return apply_filters( 'the_category', '', $separator, $parents );
|
||||
|
||||
if ( empty( $categories ) )
|
||||
return apply_filters( 'the_category', __( 'Uncategorized' ), $separator, $parents );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user