Hi,
Not a pro in PHP or WP API, but I have very simple code in functions.php that switches menus if user is logged in.
function switch_menus( $args = '' ) {
if( is_user_logged_in() ) {
$args['menu'] = 'loggedin';
} else {
$args['menu'] = 'loggedout';
}
return $args;
}
add_filter( 'wp_nav_menu_args', 'switch_menus' );
However that switches the menu for the footer as well, so I guess ['menu'] is a general parameter for all menus.
What is the parameter specifically for the main menu, in X?