if ( $menu_exists ) { return new WP_Error( 'menu_exists',
sprintf( /* translators: %s: Menu name. */
__( 'The menu name %s conflicts with another menu name. Please try another.'
),
'<strong>' .
esc_html( $menu_data['menu-name'
] ) . '</strong>'
) );
} $_menu =
wp_insert_term( $menu_data['menu-name'
], 'nav_menu',
$args );
if ( is_wp_error( $_menu ) ) { return $_menu;
} /**
* Fires after a navigation menu is successfully created.
*
* @since 3.0.0
*
* @param int $term_id ID of the new menu.
* @param array $menu_data An array of menu data.
*/