• Hi

    I am experiencing a strange error when trying to update the name of a registered menu location in functions.php

    This error only shows up when in debug mode: define(‘WP_DEBUG’, true);

    So originally the name of the menu location was primary

    register_nav_menus( array(
    	'topbar_info' => __( 'Top Header Menu (Info)', '' ),
    	'topbar_controls' => __( 'Top Header Menu (Controls)', '' ),
    	'primary' => __( 'Main Menu', '' )
    	) );

    If I change the name from ‘primary’ to ‘menu-style1’

    register_nav_menus( array(
    	'topbar_info' => __( 'Top Header Menu (Info)', '' ),
    	'topbar_controls' => __( 'Top Header Menu (Controls)', '' ),
    	'menu-style1' => __( 'Main Menu', '' )
    	) );

    I get this error on the backend: Appeararance/Menus/Edit Menus:

    Main Navigation( ! ) Notice: Undefined index: primary in C:\wamp\www\frank\wp-admin\nav-menus.php on line 627
    Call Stack #TimeMemoryFunctionLocation 10.00271127856{main}(  )..\nav-menus.php:0 (, Main Menu)

    If I turn debug off I don’t see the error. Not sure what I am doing wrong here any help is appreciated.

    thanks

  • The topic ‘Register Nav Menus’ is closed to new replies.