Changeset 28402
- Timestamp:
- 05/15/2014 01:40:48 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/post-template.php
r28401 r28402 1267 1267 */ 1268 1268 function start_el( &$output, $page, $depth = 0, $args = array(), $current_page = 0 ) { 1269 if ( $depth ) 1270 $indent = str_repeat( "\t", $depth);1271 else1269 if ( $depth ) { 1270 $indent = str_repeat( "\t", $depth ); 1271 } else { 1272 1272 $indent = ''; 1273 1274 extract($args, EXTR_SKIP); 1275 $css_class = array( 'page_item', 'page-item-'.$page->ID);1276 1277 if ( isset( $args['pages_with_children'][ $page->ID ] ) )1273 } 1274 1275 $css_class = array( 'page_item', 'page-item-' . $page->ID ); 1276 1277 if ( isset( $args['pages_with_children'][ $page->ID ] ) ) { 1278 1278 $css_class[] = 'page_item_has_children'; 1279 1280 if ( !empty($current_page) ) { 1279 } 1280 1281 if ( ! empty( $current_page ) ) { 1281 1282 $_current_page = get_post( $current_page ); 1282 if ( in_array( $page->ID, $_current_page->ancestors ) ) 1283 if ( in_array( $page->ID, $_current_page->ancestors ) ) { 1283 1284 $css_class[] = 'current_page_ancestor'; 1284 if ( $page->ID == $current_page ) 1285 } 1286 if ( $page->ID == $current_page ) { 1285 1287 $css_class[] = 'current_page_item'; 1286 elseif ( $_current_page && $page->ID == $_current_page->post_parent )1288 } elseif ( $_current_page && $page->ID == $_current_page->post_parent ) { 1287 1289 $css_class[] = 'current_page_parent'; 1290 } 1288 1291 } elseif ( $page->ID == get_option('page_for_posts') ) { 1289 1292 $css_class[] = 'current_page_parent'; … … 1304 1307 * @param int $current_page ID of the current page. 1305 1308 */ 1306 $css_class = implode( ' ', apply_filters( 'page_css_class', $css_class, $page, $depth, $args, $current_page ) );1307 1308 if ( '' === $page->post_title ) 1309 $css_classes = implode( ' ', apply_filters( 'page_css_class', $css_class, $page, $depth, $args, $current_page ) ); 1310 1311 if ( '' === $page->post_title ) { 1309 1312 $page->post_title = sprintf( __( '#%d (no title)' ), $page->ID ); 1313 } 1314 1315 $args['link_before'] = empty( $args['link_before'] ) ? '' : $args['link_before']; 1316 $args['link_after'] = empty( $args['link_after'] ) ? '' : $args['link_after']; 1310 1317 1311 1318 /** This filter is documented in wp-includes/post-template.php */ 1312 $output .= $indent . '<li class="' . $css_class . '"><a href="' . get_permalink($page->ID) . '">' . $link_before . apply_filters( 'the_title', $page->post_title, $page->ID ) . $link_after . '</a>'; 1313 1314 if ( !empty($show_date) ) { 1315 if ( 'modified' == $show_date ) 1319 $output .= $indent . sprintf( 1320 '<li class="%s"><a href="%s">%s%s%s</a>', 1321 $css_classes, 1322 get_permalink( $page->ID ), 1323 $args['link_before'], 1324 apply_filters( 'the_title', $page->post_title, $page->ID ), 1325 $args['link_after'] 1326 ); 1327 1328 if ( ! empty( $args['show_date'] ) ) { 1329 if ( 'modified' == $args['show_date'] ) { 1316 1330 $time = $page->post_modified; 1317 else1331 } else { 1318 1332 $time = $page->post_date; 1319 1320 $output .= " " . mysql2date($date_format, $time); 1333 } 1334 1335 $date_format = empty( $args['date_format'] ) ? '' : $args['date_format']; 1336 $output .= " " . mysql2date( $date_format, $time ); 1321 1337 } 1322 1338 }
Note: See TracChangeset
for help on using the changeset viewer.