In my theme, I am adding a menu upon theme activation using
add_action( 'after_setup_theme', 'mycustom_register_menu' );
function mycustom_register_menu() {
register_nav_menu( 'somelocation', __( 'My Menu') );
}
I added the location in my theme's header.php, now all that's left is to create a menu in the dashbaord and assign it to that location. It works perfectly when I do so manually.
My question is, how can I automate it? so when the theme is activated and "My Menu" is added as a location, a menu with a certain name is created and assigned to that location? Is there a hook for that?