[wp-trac] [WordPress Trac] #24014: Undefined variable: nav_menu_id in /wp-includes/nav-menu.php on line 195

WordPress Trac noreply at wordpress.org
Tue Apr 9 19:51:44 UTC 2013


#24014: Undefined variable: nav_menu_id in /wp-includes/nav-menu.php on line 195
-----------------------------+--------------------------
 Reporter:  chipbennett      |       Type:  defect (bug)
   Status:  new              |   Priority:  normal
Milestone:  Awaiting Review  |  Component:  Menus
  Version:  trunk            |   Severity:  minor
 Keywords:                   |
-----------------------------+--------------------------
 To reproduce:

 1. Delete an existing nav menu

 Error (PHP notice):

 {{{
 Notice: Undefined variable: nav_menu_id in /xxxxxx/wp-includes/nav-
 menu.php on line 195
 }}}

 [http://core.trac.wordpress.org/browser/trunk/wp-includes/nav-menu.php
 Core code]:

 {{{
       // Remove this menu from any locations.
 193             $locations = get_theme_mod( 'nav_menu_locations' );
 194             foreach ( (array) $locations as $location => $menu_id ) {
 195                     if ( $menu_id == $nav_menu_id )
 196                             $locations[ $location ] = 0;
 197             }
 198             set_theme_mod( 'nav_menu_locations', $locations );
 }}}

 Offending line:
 {{{
 if ( $menu_id == $nav_menu_id )
 }}}
 ...but `$nav_menu_id` is not defined in the function.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/24014>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list