WordPress.org

Make WordPress Core

Ticket #41583: nav-menus-performance.diff

File nav-menus-performance.diff, 1.2 KB (added by webgeekconsulting, 2 years ago)
  • wp-admin/nav-menus.php

    diff --git wp-admin/nav-menus.php wp-admin/nav-menus.php
    index d8fc77f01..212dcb519 100644
    if ( $nav_menu_selected_id != $recently_edited && is_nav_menu( $nav_menu_selecte 
    465465        update_user_meta( $current_user->ID, 'nav_menu_recently_edited', $nav_menu_selected_id );
    466466
    467467// If there's a menu, get its name.
    468 if ( ! $nav_menu_selected_title && is_nav_menu( $nav_menu_selected_id ) ) {
     468if ( ! $add_new_screen && ! $locations_screen && ! $nav_menu_selected_title && is_nav_menu( $nav_menu_selected_id ) ) {
    469469        $_menu_object = wp_get_nav_menu_object( $nav_menu_selected_id );
    470470        $nav_menu_selected_title = ! is_wp_error( $_menu_object ) ? $_menu_object->name : '';
    471471}
    global $_wp_nav_menu_max_depth; 
    491491$_wp_nav_menu_max_depth = 0;
    492492
    493493// Calling wp_get_nav_menu_to_edit generates $_wp_nav_menu_max_depth.
    494 if ( is_nav_menu( $nav_menu_selected_id ) ) {
     494if ( ! $add_new_screen && ! $locations_screen && is_nav_menu( $nav_menu_selected_id ) ) {
    495495        $menu_items = wp_get_nav_menu_items( $nav_menu_selected_id, array( 'post_status' => 'any' ) );
    496496        $edit_markup = wp_get_nav_menu_to_edit( $nav_menu_selected_id );
    497497}