Changeset 13286
- Timestamp:
- 02/22/2010 12:26:21 AM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/custom-navigation.php
r13284 r13286 135 135 if (isset($_POST['dbid'.$k])) { $db_id = $_POST['dbid'.$k]; } else { $db_id = 0; } 136 136 if (isset($_POST['postmenu'.$k])) { $object_id = $_POST['postmenu'.$k]; } else { $object_id = 0; } 137 //@todo implement heirarchy138 137 if (isset($_POST['parent'.$k])) { $parent_id = $_POST['parent'.$k]; } else { $parent_id = 0; } 139 138 if (isset($_POST['title'.$k])) { $custom_title = $_POST['title'.$k]; } else { $custom_title = ''; } … … 155 154 else 156 155 $post['post_content_filtered'] = ''; 156 if ( $parent_id > 0 && isset( $_POST[ 'dbid' . $parent_id ] ) ) 157 $post[ 'post_parent' ] = (int) $_POST[ 'dbid' . $parent_id ]; 157 158 158 159 // New menu item -
trunk/wp-includes/custom-navigation.php
r13284 r13286 115 115 elseif ( is_category() ) 116 116 $queried_id = $wp_query->get_queried_object_id(); 117 118 $parent_stack = array(); 117 119 // Display Loop 118 120 foreach ( $menu_items as $menu_item ) { … … 192 194 } 193 195 */ 196 // Indent children 197 if ( empty( $parent_stack ) ) { 198 array_unshift( $parent_stack, $menu_item->ID ); 199 } elseif ( $menu_item->post_parent > 0 ) { 200 if ( $menu_item->post_parent == $parent_stack[0] ) { ?> 201 <ul> 202 <?php array_unshift( $parent_stack, $menu_item->ID ); 203 } elseif ( count( $parent_stack ) > 1 && $menu_item->post_parent == $parent_stack[1] ) { ?> 204 </li> 205 <?php $parent_stack[0] = $menu_item->ID; 206 } elseif ( in_array( $menu_item->post_parent, $parent_stack ) ) { 207 while ( !empty( $parent_stack ) && $menu_item->post_parent != $parent_stack[0] ) { ?> 208 </li></ul> 209 <? array_shift( $parent_stack ); 210 } 211 } 212 } else { ?> 213 </li> 214 <?php $parent_stack[0] = $menu_item->ID; 215 } 216 194 217 // List Items 195 218 ?><li id="menu-<?php echo $menu_item->ID; ?>" value="<?php echo $menu_item->ID; ?>" <?php echo $li_class; ?>><?php … … 257 280 <?php 258 281 } 259 260 //@todo: implement menu heirarchy261 /* //DISPLAY menu sub items262 if ($wp_custom_nav_menu_items->parent_id == 0)263 {264 //FRONTEND265 if ($type == 'frontend')266 {267 //Recursive function268 $intj = wp_custom_navigation_sub_items($wp_custom_nav_menu_items->id,$wp_custom_nav_menu_items->link_type,$table_name,$type,$wp_custom_nav_menu_id);269 }270 //BACKEND271 else272 {273 //Recursive function274 $intj = wp_custom_navigation_sub_items($wp_custom_nav_menu_items->id,$wp_custom_nav_menu_items->link_type,$table_name,$type,$id);275 }276 }277 */ ?></li>278 <?php279 282 } 283 while ( !empty( $parent_stack ) ) { ?> 284 </li></ul> 285 <? array_shift( $parent_stack ); 286 } 287 if ( !empty( $menu_items ) ) { ?> 288 </li> 289 <?php } 280 290 } 281 291 //@todo: implement menu heirarchy
Note: See TracChangeset
for help on using the changeset viewer.