Actually I think you need to hide or show the menu items based on “User Role”. So here a possible solution would be creating menus for each roles and showing them by condition based on “User Role”. Here is the code-
function the_dramatist_menu_change( $args="" ) {
$current_user = wp_get_current_user();
if( in_array('your-user-role', $current_user->roles) ) {
$args['menu'] = 'Menu 1'; // Menu name as string
} else {
$args['menu'] = 'Menu 2'; // Menu name as string
}
// Add more else if condition based on your user roles.
return $args;
}
add_filter( 'wp_nav_menu_args', 'the_dramatist_menu_change' );