Changeset 13322
- Timestamp:
- 02/23/2010 03:19:30 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/custom-navigation.php
r13318 r13322 41 41 if ( !empty( $custom_menus ) ) { 42 42 foreach ( $custom_menus as $menu ) { 43 $menu_objects = get_objects_in_term( $menu->term_id, 'nav_menu' ); 44 if ( !empty( $menu_objects ) ) { 45 foreach ( $menu_objects as $item ) { 46 wp_delete_post( $item ); 47 } 48 } 49 wp_delete_term( $menu->term_id, 'nav_menu' ); 43 wp_custom_navigation_delete_menu( $menu->term_id ); 50 44 } 45 } 46 } 47 function wp_custom_navigation_delete_menu( $menu_term_id ) { 48 $term_id = (int) $menu_term_id; 49 if ( $term_id > 0 ) { 50 $menu_objects = get_objects_in_term( $term_id, 'nav_menu' ); 51 if ( !empty( $menu_objects ) ) { 52 foreach ( $menu_objects as $item ) { 53 wp_delete_post( $item ); 54 } 55 } 56 wp_delete_term( $term_id, 'nav_menu' ); 51 57 } 52 58 }
Note: See TracChangeset
for help on using the changeset viewer.