WordPress.org

Make WordPress Core

Changeset 14562


Ignore:
Timestamp:
05/11/10 16:41:23 (5 years ago)
Author:
ryan
Message:

Defer term counting until all nav menu items are updated. see #12734

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/nav-menus.php

    r14505 r14562  
    301301                $menu_items = wp_get_nav_menu_items( $nav_menu_selected_id, array('orderby' => 'ID', 'output' => ARRAY_A, 'output_key' => 'ID') ); 
    302302                $post_fields = array( 'menu-item-db-id', 'menu-item-object-id', 'menu-item-object', 'menu-item-parent-id', 'menu-item-position', 'menu-item-type', 'menu-item-append', 'menu-item-title', 'menu-item-url', 'menu-item-description', 'menu-item-attr-title', 'menu-item-target', 'menu-item-classes', 'menu-item-xfn' ); 
     303                wp_defer_term_counting(true); 
    303304                // Loop through all the menu items' POST variables 
    304305                if ( ! empty( $_POST['menu-item-db-id'] ) ) { 
     
    330331                    } 
    331332                } 
     333 
     334                wp_defer_term_counting(false); 
    332335 
    333336                do_action( 'wp_update_nav_menu', $nav_menu_selected_id ); 
Note: See TracChangeset for help on using the changeset viewer.