[wp-trac] [WordPress Trac] #13485: Undefined Index when enabling Nav-Menus

WordPress Trac wp-trac at lists.automattic.com
Fri May 21 18:42:07 UTC 2010


#13485: Undefined Index when enabling Nav-Menus
--------------------------+-------------------------------------------------
 Reporter:  etiger13      |       Owner:     
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  3.0
Component:  Menus         |     Version:  3.0
 Severity:  trivial       |    Keywords:     
--------------------------+-------------------------------------------------
 In functions.php of my template file I added:

 {{{
 add_theme_support('nav-menus');
 }}}


 On the admin -> appearance -> Menus page I get at the top of the page:

 {{{
 Notice: Undefined index: _wp_registered_nav_menus in
 /Users/eddie/Dropbox/Web/DevSites/blog/wp-includes/nav-menu.php  on line
 101

 Notice: Undefined index: _wp_registered_nav_menus in
 /Users/eddie/Dropbox/Web/DevSites/blog/wp-includes/nav-menu.php on line
 101

 Warning: Cannot modify header information - headers already sent by
 (output started at /Users/eddie/Dropbox/Web/DevSites/blog/wp-includes/nav-
 menu.php:101) in /Users/eddie/Dropbox/Web/DevSites/blog/wp-
 includes/functions.php on line 823

 Warning: Cannot modify header information - headers already sent by
 (output started at /Users/eddie/Dropbox/Web/DevSites/blog/wp-includes/nav-
 menu.php:101) in /Users/eddie/Dropbox/Web/DevSites/blog/wp-
 includes/functions.php on line 824
 }}}

 On line 100 of /wp-includes/nav-menu.php a check should be made to see if
 the index exists. Function should be changed to the below:

 {{{
 function get_registered_nav_menus() {
         if ( isset($GLOBALS['_wp_registered_nav_menus']) )
                 return $GLOBALS['_wp_registered_nav_menus'];
 }
 }}}

 This is on PHP 5.3.1.

 This is not a mission critical. It is a minor annoyance that occurs with
 PHP error reporting on and outputting to the screen

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


More information about the wp-trac mailing list