Ticket #11838: 11838.2.diff
| File 11838.2.diff, 3.0 KB (added by , 17 years ago) |
|---|
-
category-template.php
438 438 */ 439 439 function wp_list_categories( $args = '' ) { 440 440 $defaults = array( 441 'show_option_all' => '', 'orderby' => 'name', 442 'order' => 'ASC', 'show_last_update' => 0, 443 'style' => 'list', 'show_count' => 0, 444 'hide_empty' => 1, 'use_desc_for_title' => 1, 445 'child_of' => 0, 'feed' => '', 'feed_type' => '', 446 'feed_image' => '', 'exclude' => '', 'exclude_tree' => '', 'current_category' => 0, 441 'show_option_all' => '', 'show_option_none' => __('No categories'), 442 'orderby' => 'name', 'order' => 'ASC', 443 'show_last_update' => 0, 'style' => 'list', 444 'show_count' => 0, 'hide_empty' => 1, 445 'use_desc_for_title' => 1, 'child_of' => 0, 446 'feed' => '', 'feed_type' => '', 447 'feed_image' => '', 'exclude' => '', 448 'exclude_tree' => '', 'current_category' => 0, 447 449 'hierarchical' => true, 'title_li' => __( 'Categories' ), 448 'echo' => 1, 'depth' => 0 450 'echo' => 1, 'depth' => 0, 451 'taxonomy' => 'category' 449 452 ); 450 453 451 454 $r = wp_parse_args( $args, $defaults ); … … 462 465 $r['exclude_tree'] = $r['exclude']; 463 466 $r['exclude'] = ''; 464 467 } 468 469 if ( !isset( $r['class'] ) ) { 470 $r['class'] = ( 'category' == $r['taxonomy'] ) ? 'categories' : $r['taxonomy']; 471 } 465 472 466 473 extract( $r ); 467 474 … … 469 476 470 477 $output = ''; 471 478 if ( $title_li && 'list' == $style ) 472 $output = '<li class=" categories">' . $r['title_li']. '<ul>';479 $output = '<li class="' . $class . '">' . $title_li . '<ul>'; 473 480 474 481 if ( empty( $categories ) ) { 475 if ( 'list' == $style ) 476 $output .= '<li>' . __( "No categories" ) . '</li>'; 477 else 478 $output .= __( "No categories" ); 482 if ( ! empty( $show_option_none ) ) { 483 if ( 'list' == $style ) 484 $output .= '<li>' . $show_option_none . '</li>'; 485 else 486 $output .= $show_option_none; 487 } 479 488 } else { 480 489 global $wp_query; 481 490 … … 485 494 else 486 495 $output .= '<a href="' . get_bloginfo( 'url' ) . '">' . $show_option_all . '</a>'; 487 496 488 if ( empty( $r['current_category'] ) && is_category() )497 if ( empty( $r['current_category'] ) && ( is_category() || is_tax() ) ) 489 498 $r['current_category'] = $wp_query->get_queried_object_id(); 490 499 491 500 if ( $hierarchical ) -
classes.php
1342 1342 1343 1343 $cat_name = esc_attr( $category->name); 1344 1344 $cat_name = apply_filters( 'list_cats', $cat_name, $category ); 1345 $link = '<a href="' . get_category_link( $category->term_id ) . '" '; 1345 if ( 'category' == $category->taxonomy ) 1346 $link = '<a href="' . get_category_link( $category->term_id ) . '" '; 1347 else 1348 $link = '<a href="' . get_term_link( $category, $category->taxonomy ) . '" '; 1346 1349 if ( $use_desc_for_title == 0 || empty($category->description) ) 1347 1350 $link .= 'title="' . sprintf(__( 'View all posts filed under %s' ), $cat_name) . '"'; 1348 1351 else
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)