Changeset 6125 for trunk/wp-includes/category-template.php
- Timestamp:
- 09/18/07 16:32:22 (1 year ago)
- Files:
-
- trunk/wp-includes/category-template.php (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/wp-includes/category-template.php
r6091 r6125 13 13 14 14 $category = get_category($cat_id); 15 if ( is_wp_error( $category ) ) 16 return $category; 15 17 if ( $category->parent == $id ) { 16 18 $chain .= $before.$category->term_id.$after; … … 30 32 } else { 31 33 $category = &get_category($category_id); 34 if ( is_wp_error( $category ) ) 35 return $category; 32 36 $category_nicename = $category->slug; 33 37 … … 44 48 $chain = ''; 45 49 $parent = &get_category($id); 50 if ( is_wp_error( $parent ) ) 51 return $parent; 46 52 47 53 if ( $nicename ) … … 99 105 $cat_ID = (int) $cat_ID; 100 106 $category = &get_category($cat_ID); 107 if ( is_wp_error( $category ) ) 108 return $category; 101 109 return $category->name; 102 110 } … … 314 322 315 323 $return = wp_generate_tag_cloud( $tags, $args ); // Here's where those top tags get sorted according to $args 316 echo apply_filters( 'wp_tag_cloud', $return, $args ); 324 if ( is_wp_error( $return ) ) 325 return false; 326 else 327 echo apply_filters( 'wp_tag_cloud', $return, $args ); 317 328 } 318 329 … … 335 346 $counts[$tag->name] = $tag->count; 336 347 $tag_links[$tag->name] = get_tag_link( $tag->term_id ); 348 if ( is_wp_error( $tag_links[$tag->name] ) ) 349 return $tag_links[$tag->name]; 337 350 $tag_ids[$tag->name] = $tag->term_id; 338 351 } … … 411 424 412 425 $tag = &get_term($tag_id, 'post_tag'); 426 if ( is_wp_error( $tag ) ) 427 return $tag; 413 428 $slug = $tag->slug; 414 429 … … 451 466 452 467 $tag_list = $before; 453 foreach ( $tags as $tag ) 454 $tag_links[] = '<a href="' . get_tag_link($tag->term_id) . '" rel="tag">' . $tag->name . '</a>'; 468 foreach ( $tags as $tag ) { 469 $link = get_tag_link($tag->term_id); 470 if ( is_wp_error( $link ) ) 471 return $link; 472 $tag_links[] = '<a href="' . $link . '" rel="tag">' . $tag->name . '</a>'; 473 } 455 474 456 475 $tag_links = join( $sep, $tag_links ); … … 464 483 465 484 function the_tags( $before = 'Tags: ', $sep = ', ', $after = '' ) { 466 echo get_the_tag_list($before, $sep, $after); 485 $return = get_the_tag_list($before, $sep, $after); 486 if ( is_wp_error( $return ) ) 487 return false; 488 else 489 echo $return; 467 490 } 468 491
