Buralara bakın;

https://codex.wordpress.org/Function_Reference/wp_create_nav_menu