Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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);
- }
- }
- add_filter( 'myblogs_blog_actions', 'my_sites_visit_site_target_blank', 10, 2 );
- function my_sites_visit_site_target_blank( $actions, $user_blog ) {
- $to_replace = ">" . __( 'Visit' ) . '</a>';
- $to_replace_with = " target='_blank' >" . __( 'Visit' ) . '</a>';
- return str_replace( $to_replace, $to_replace_with, $actions );
- }
Add Comment
Please, Sign In to add comment