Changeset 16204
- Timestamp:
- 11/05/2010 12:47:19 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/post-template.php
r16200 r16204 345 345 346 346 // Categories 347 foreach ( (array) get_the_category($post->ID) as $cat ) { 348 if ( empty($cat->slug ) ) 349 continue; 350 $classes[] = 'category-' . sanitize_html_class($cat->slug, $cat->cat_ID); 347 if ( is_object_in_taxonomy( $post->post_type, 'category' ) ) { 348 foreach ( (array) get_the_category($post->ID) as $cat ) { 349 if ( empty($cat->slug ) ) 350 continue; 351 $classes[] = 'category-' . sanitize_html_class($cat->slug, $cat->cat_ID); 352 } 351 353 } 352 354 353 355 // Tags 354 foreach ( (array) get_the_tags($post->ID) as $tag ) { 355 if ( empty($tag->slug ) ) 356 continue; 357 $classes[] = 'tag-' . sanitize_html_class($tag->slug, $tag->term_id); 356 if ( is_object_in_taxonomy( $post->post_type, 'post_tag' ) ) { 357 foreach ( (array) get_the_tags($post->ID) as $tag ) { 358 if ( empty($tag->slug ) ) 359 continue; 360 $classes[] = 'tag-' . sanitize_html_class($tag->slug, $tag->term_id); 361 } 358 362 } 359 363
Note: See TracChangeset
for help on using the changeset viewer.