I added two menus
register_nav_menus (
array(
'primary_menu' => esc_html__('Primary Menu', 'sre'),
'footer_menu' => esc_html__('Footer Menu', 'sre'),
)
);
But I'm unable to remove the two old ones, Primary menu
and Secondary menu
When I use this code, it hides Primary menu
but when I remove the code, it reappears in the list.
add_action( 'after_setup_theme', 'remove_default_menu', 11 );
function remove_default_menu(){
unregister_nav_menu('primary');
}