Changeset 28436
- Timestamp:
- 05/15/2014 05:57:13 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/category-template.php
r28435 r28436 963 963 */ 964 964 function start_el( &$output, $category, $depth = 0, $args = array(), $id = 0 ) { 965 extract($args);966 967 $cat_name = esc_attr( $category->name );968 969 965 /** This filter is documented in wp-includes/category-template.php */ 970 $cat_name = apply_filters( 'list_cats', $cat_name, $category ); 971 972 $link = '<a href="' . esc_url( get_term_link($category) ) . '" '; 973 if ( $use_desc_for_title == 0 || empty($category->description) ) { 966 $cat_name = apply_filters( 967 'list_cats', 968 esc_attr( $category->name ), 969 $category 970 ); 971 972 $link = '<a href="' . esc_url( get_term_link( $category ) ) . '" '; 973 if ( $args['use_desc_for_title'] == 0 || empty( $category->description ) ) { 974 974 $link .= ''; 975 975 } else { … … 988 988 $link .= $cat_name . '</a>'; 989 989 990 if ( ! empty($feed_image) || !empty($feed) ) {990 if ( ! empty( $args['feed_image'] ) || ! empty( $args['feed'] ) ) { 991 991 $link .= ' '; 992 992 993 if ( empty( $feed_image) )993 if ( empty( $args['feed_image'] ) ) { 994 994 $link .= '('; 995 996 $link .= '<a href="' . esc_url( get_term_feed_link( $category->term_id, $category->taxonomy, $feed_type ) ) . '"'; 997 998 if ( empty($feed) ) { 995 } 996 997 $link .= '<a href="' . esc_url( get_term_feed_link( $category->term_id, $category->taxonomy, $args['feed_type'] ) ) . '"'; 998 999 if ( empty( $args['feed'] ) ) { 999 1000 $alt = ' alt="' . sprintf(__( 'Feed for all posts filed under %s' ), $cat_name ) . '"'; 1000 1001 } else { 1001 $alt = ' alt="' . $ feed. '"';1002 $name = $ feed;1003 $link .= $ title;1002 $alt = ' alt="' . $args['feed'] . '"'; 1003 $name = $args['feed']; 1004 $link .= $args['title']; 1004 1005 } 1005 1006 1006 1007 $link .= '>'; 1007 1008 1008 if ( empty( $feed_image) )1009 if ( empty( $args['feed_image'] ) ) { 1009 1010 $link .= $name; 1010 else1011 $link .= "<img src=' $feed_image'$alt" . ' />';1012 1011 } else { 1012 $link .= "<img src='" . $args['feed_image'] . "'$alt" . ' />'; 1013 } 1013 1014 $link .= '</a>'; 1014 1015 1015 if ( empty( $feed_image) )1016 if ( empty( $args['feed_image'] ) ) { 1016 1017 $link .= ')'; 1017 } 1018 1019 if ( !empty($show_count) ) 1018 } 1019 } 1020 1021 if ( ! empty( $args['show_count'] ) ) { 1020 1022 $link .= ' (' . number_format_i18n( $category->count ) . ')'; 1021 1023 } 1022 1024 if ( 'list' == $args['style'] ) { 1023 1025 $output .= "\t<li"; 1024 1026 $class = 'cat-item cat-item-' . $category->term_id; 1025 if ( ! empty($current_category) ) {1026 $_current_category = get_term( $ current_category, $category->taxonomy );1027 if ( $category->term_id == $ current_category )1027 if ( ! empty( $args['current_category'] ) ) { 1028 $_current_category = get_term( $args['current_category'], $category->taxonomy ); 1029 if ( $category->term_id == $args['current_category'] ) { 1028 1030 $class .= ' current-cat'; 1029 elseif ( $category->term_id == $_current_category->parent )1031 } elseif ( $category->term_id == $_current_category->parent ) { 1030 1032 $class .= ' current-cat-parent'; 1033 } 1031 1034 } 1032 1035 $output .= ' class="' . $class . '"';
Note: See TracChangeset
for help on using the changeset viewer.