I have the following code to show different menus to logged in members. I would like to add two total menusa second menu to be displayed when logged in, for a total of 3 menus, as there are two different menu areas for logged-in users.
function my_wp_nav_menu_args( $args = '' ) {
if( is_user_logged_in() ) {
$args['menu'] = 'menu-1';
} else {
$args['menu'], $args['menu'] = 'menu-3';
}
return $args;
}
add_filter( 'wp_nav_menu_args', 'my_wp_nav_menu_args' );
When using this code as-is, "menu-1" will display twice in the 2 areas. I can not figure out the syntax to add another menu line to include "menu-2". Can someone let me know what to change?