Register menu, create items and assign menu to location
//Register menu function
if ( functionexists( 'addthemesupport' ) )
addthemesupport ('nav-menus');
addaction('init', 'registrarnavegacion' );
function registrarnavegacion() {
registernavmenus (array(
'header' => __('Menu Header', 'storelicious' ),
));
}
function createmenu() {
$menuid = wpcreatenavmenu('Top Menu');
$menu = array(
'menu-item-type' => 'custom',
'menu-item-url' => gethomeurl('/'),
'menu-item-title' => 'Home',
'menu-item-status' => 'publish',
);
wpupdatenavmenuitem( $menuid, 0, $menu );
$locations = getthememod('navmenulocations');
$locations['header'] = $menuid ;
setthememod('navmenulocations', $locations);
}
if( ! hasnavmenu('header') ){ addaction('init', 'create_menu' ); }