WordPress at a glance
function is not described

wp_create_nav_menu() WP 3.0.0

Creates a navigation menu.

Note that $menu_name is expected to be pre-slashed.

No Hooks.


Int/WP_Error. Menu ID on success, WP_Error object on failure.


wp_create_nav_menu( $menu_name );
$menu_name(string) (required)
Menu name.

Code of wp create nav menu: wp-includes/nav-menu.php WP 5.2.2

function wp_create_nav_menu( $menu_name ) {
	// expected_slashed ($menu_name)
	return wp_update_nav_menu_object( 0, array( 'menu-name' => $menu_name ) );