Ticket #9304: page_css_class.diff
File page_css_class.diff, 1.7 KB (added by , 16 years ago) |
---|
-
wp-includes/classes.php
1172 1172 $indent = ''; 1173 1173 1174 1174 extract($args, EXTR_SKIP); 1175 $css_class = 'page_item page-item-'.$page->ID;1175 $css_class = array('page_item', 'page-item-'.$page->ID); 1176 1176 if ( !empty($current_page) ) { 1177 1177 $_current_page = get_page( $current_page ); 1178 1178 if ( isset($_current_page->ancestors) && in_array($page->ID, (array) $_current_page->ancestors) ) 1179 $css_class .= 'current_page_ancestor';1179 $css_class[] = 'current_page_ancestor'; 1180 1180 if ( $page->ID == $current_page ) 1181 $css_class .= 'current_page_item';1181 $css_class[] = 'current_page_item'; 1182 1182 elseif ( $_current_page && $page->ID == $_current_page->post_parent ) 1183 $css_class .= 'current_page_parent';1183 $css_class[] = 'current_page_parent'; 1184 1184 } elseif ( $page->ID == get_option('page_for_posts') ) { 1185 $css_class .= 'current_page_parent';1185 $css_class[] = 'current_page_parent'; 1186 1186 } 1187 1187 1188 $output .= $indent . '<li class="' . $css_class. '"><a href="' . get_page_link($page->ID) . '" title="' . attribute_escape(apply_filters('the_title', $page->post_title)) . '">' . $link_before . apply_filters('the_title', $page->post_title) . $link_after . '</a>';1188 $output .= $indent . '<li class="' . implode(' ', apply_filters('page_css_class', $css_class, $page)) . '"><a href="' . get_page_link($page->ID) . '" title="' . attribute_escape(apply_filters('the_title', $page->post_title)) . '">' . $link_before . apply_filters('the_title', $page->post_title) . $link_after . '</a>'; 1189 1189 1190 1190 if ( !empty($show_date) ) { 1191 1191 if ( 'modified' == $show_date )