Support » Fixing WordPress » View Site (in new window)

  • Is there a way to change the base WP so that after I update a page, and it shows me, “View Page” in the banner near the top, that that link could be “open page in new window?”

    Thanks

Viewing 1 replies (of 1 total)
  • Hi piltdownman. Add this function and hook to your child theme functions.php file:

    function my_custom_wp_admin_bar( $wp_admin_bar ) {
        // Get a reference to the View Page node in the admin toolbar
        $node = $wp_admin_bar->get_node('view');
        // Change target
        $node->meta['target'] = '_blank';
        // Update Node
        $wp_admin_bar->add_node($node);
    }
    add_action( 'admin_bar_menu', 'my_custom_wp_admin_bar', 999 );
Viewing 1 replies (of 1 total)
  • The topic ‘View Site (in new window)’ is closed to new replies.