Changeset 27556 for trunk/src/wp-includes/nav-menu.php
- Timestamp:
- 03/15/2014 06:06:41 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/nav-menu.php
r27251 r27556 366 366 $update = 0 != $menu_item_db_id; 367 367 368 // Only set the menu term if it isn't set to avoid unnecessary wp_get_object_terms()369 if ( $menu_id && ( ! $update || ! is_object_in_term( $menu_item_db_id, 'nav_menu', (int) $menu->term_id ) ) )370 $post['tax_input'] = array( 'nav_menu' => array( intval( $menu->term_id ) ) );371 372 368 // New menu item. Default is draft status 373 369 if ( ! $update ) { … … 377 373 if ( ! $menu_item_db_id || is_wp_error( $menu_item_db_id ) ) 378 374 return $menu_item_db_id; 375 } 376 377 // Associate the menu item with the menu term 378 // Only set the menu term if it isn't set to avoid unnecessary wp_get_object_terms() 379 if ( $menu_id && ( ! $update || ! is_object_in_term( $menu_item_db_id, 'nav_menu', (int) $menu->term_id ) ) ) { 380 wp_set_object_terms( $menu_item_db_id, array( $menu->term_id ), 'nav_menu' ); 379 381 } 380 382
Note: See TracChangeset
for help on using the changeset viewer.