Changeset 31027
- Timestamp:
- 01/03/2015 02:30:14 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/category-template.php
r31025 r31027 1054 1054 if ( 'list' == $args['style'] ) { 1055 1055 $output .= "\t<li"; 1056 $class = 'cat-item cat-item-' . $category->term_id; 1056 $css_classes = array( 1057 'cat-item', 1058 'cat-item-' . $category->term_id, 1059 ); 1060 1057 1061 if ( ! empty( $args['current_category'] ) ) { 1058 1062 $_current_category = get_term( $args['current_category'], $category->taxonomy ); 1059 1063 if ( $category->term_id == $args['current_category'] ) { 1060 $c lass .= 'current-cat';1064 $css_classes[] = 'current-cat'; 1061 1065 } elseif ( $category->term_id == $_current_category->parent ) { 1062 $c lass .= 'current-cat-parent';1066 $css_classes[] = 'current-cat-parent'; 1063 1067 } 1064 1068 } 1065 $output .= ' class="' . $class . '"'; 1069 1070 /** 1071 * Filter the list of CSS classes to include with each category in the list. 1072 * 1073 * @since 4.2.0 1074 * 1075 * @see wp_list_categories() 1076 * 1077 * @param array $css_classes An array of CSS classes to be applied 1078 * to each list item. 1079 * @param object $category Category data object. 1080 * @param int $depth Depth of page, used for padding. 1081 * @param array $args An array of arguments. 1082 */ 1083 $css_classes = implode( ' ', apply_filters( 'category_css_class', $css_classes, $category, $depth, $args ) ); 1084 1085 $output .= ' class="' . $css_classes . '"'; 1066 1086 $output .= ">$link\n"; 1067 1087 } else {
Note: See TracChangeset
for help on using the changeset viewer.