I have managed to make the admin bar "Visit site" to open in a new window. But in a multisite setup there is a menu item called "My sites" which displays all your sites with a link to "Dashboard" and "Visit site". How do I make this "Visit site" button open in a new link?
Thank you!
EDIT: Here is the solution for the drop-down menu "My sites":
add_action( 'admin_bar_menu', 'remove_nodes_mysites', 999 );
function remove_nodes_mysites( $bar )
{
$sites = get_blogs_of_user( get_current_user_id() );
foreach ( $sites as $site )
{
// Open Visit Site in new window/tab
$visit_site_node = $bar->get_node( "blog-{$site->userblog_id}-v" ); // Visit Site
$visit_site_node->meta['target'] = '_blank';
$bar->add_node($visit_site_node);
}
}