Changeset 25602
- Timestamp:
- 09/24/2013 04:00:14 PM (11 years ago)
- Location:
- trunk/src/wp-includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/nav-menu-template.php
r25410 r25602 272 272 _wp_menu_item_classes_by_context( $menu_items ); 273 273 274 $sorted_menu_items = array(); 275 foreach ( (array) $menu_items as $key => $menu_item ) 276 $sorted_menu_items[$menu_item->menu_order] = $menu_item; 277 278 unset($menu_items); 274 $sorted_menu_items = $menu_items_with_children = array(); 275 foreach ( (array) $menu_items as $menu_item ) { 276 $sorted_menu_items[ $menu_item->menu_order ] = $menu_item; 277 if ( $menu_item->menu_item_parent ) 278 $menu_items_with_children[ $menu_item->menu_item_parent ] = true; 279 } 280 281 // Add the menu-item-has-children class where applicable 282 if ( $menu_items_with_children ) { 283 foreach ( $sorted_menu_items as &$menu_item ) { 284 if ( isset( $menu_items_with_children[ $menu_item->ID ] ) ) 285 $menu_item->classes[] = 'menu-item-has-children'; 286 } 287 } 288 289 unset( $menu_items, $menu_item ); 279 290 280 291 /** -
trunk/src/wp-includes/post-template.php
r25582 r25602 956 956 $walker = $r['walker']; 957 957 958 foreach ( (array) $pages as $page ) { 959 if ( $page->post_parent ) 960 $r['pages_with_children'][ $page->post_parent ] = true; 961 } 962 958 963 $args = array($pages, $depth, $r, $current_page); 959 964 return call_user_func_array(array($walker, 'walk'), $args); … … 1044 1049 extract($args, EXTR_SKIP); 1045 1050 $css_class = array('page_item', 'page-item-'.$page->ID); 1051 1052 if( isset( $args['pages_with_children'][ $page->ID ] ) ) 1053 $css_class[] = 'page_item_has_children'; 1054 1046 1055 if ( !empty($current_page) ) { 1047 1056 $_current_page = get_post( $current_page );
Note: See TracChangeset
for help on using the changeset viewer.