Changeset 13854 for trunk/wp-includes/category-template.php
- Timestamp:
- 03/28/2010 02:07:31 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/category-template.php
r13813 r13854 449 449 function wp_list_categories( $args = '' ) { 450 450 $defaults = array( 451 'show_option_all' => '', 'orderby' => 'name', 452 'order' => 'ASC', 'show_last_update' => 0, 453 'style' => 'list', 'show_count' => 0, 454 'hide_empty' => 1, 'use_desc_for_title' => 1, 455 'child_of' => 0, 'feed' => '', 'feed_type' => '', 456 'feed_image' => '', 'exclude' => '', 'exclude_tree' => '', 'current_category' => 0, 451 'show_option_all' => '', 'show_option_none' => __('No categories'), 452 'orderby' => 'name', 'order' => 'ASC', 453 'show_last_update' => 0, 'style' => 'list', 454 'show_count' => 0, 'hide_empty' => 1, 455 'use_desc_for_title' => 1, 'child_of' => 0, 456 'feed' => '', 'feed_type' => '', 457 'feed_image' => '', 'exclude' => '', 458 'exclude_tree' => '', 'current_category' => 0, 457 459 'hierarchical' => true, 'title_li' => __( 'Categories' ), 458 'echo' => 1, 'depth' => 0 460 'echo' => 1, 'depth' => 0, 461 'taxonomy' => 'category' 459 462 ); 460 463 461 464 $r = wp_parse_args( $args, $defaults ); 462 465 463 if ( !isset( $r['pad_counts'] ) && $r['show_count'] && $r['hierarchical'] ) {466 if ( !isset( $r['pad_counts'] ) && $r['show_count'] && $r['hierarchical'] ) 464 467 $r['pad_counts'] = true; 465 } 466 467 if ( isset( $r['show_date'] ) ) { 468 469 if ( isset( $r['show_date'] ) ) 468 470 $r['include_last_update_time'] = $r['show_date']; 469 }470 471 471 472 if ( true == $r['hierarchical'] ) { … … 473 474 $r['exclude'] = ''; 474 475 } 476 477 if ( !isset( $r['class'] ) ) 478 $r['class'] = ( 'category' == $r['taxonomy'] ) ? 'categories' : $r['taxonomy']; 475 479 476 480 extract( $r ); 481 482 if ( !is_taxonomy($taxonomy) ) 483 return false; 477 484 478 485 $categories = get_categories( $r ); … … 480 487 $output = ''; 481 488 if ( $title_li && 'list' == $style ) 482 $output = '<li class=" categories">' . $r['title_li']. '<ul>';489 $output = '<li class="' . $class . '">' . $title_li . '<ul>'; 483 490 484 491 if ( empty( $categories ) ) { 485 if ( 'list' == $style ) 486 $output .= '<li>' . __( "No categories" ) . '</li>'; 487 else 488 $output .= __( "No categories" ); 492 if ( ! empty( $show_option_none ) ) { 493 if ( 'list' == $style ) 494 $output .= '<li>' . $show_option_none . '</li>'; 495 else 496 $output .= $show_option_none; 497 } 489 498 } else { 490 499 global $wp_query; … … 496 505 $output .= '<a href="' . get_bloginfo( 'url' ) . '">' . $show_option_all . '</a>'; 497 506 498 if ( empty( $r['current_category'] ) && is_category() )507 if ( empty( $r['current_category'] ) && ( is_category() || is_tax() ) ) 499 508 $r['current_category'] = $wp_query->get_queried_object_id(); 500 509
Note: See TracChangeset
for help on using the changeset viewer.