Viewing 1 replies (of 1 total)
  • If any of those links that have a class, id or other selector in their HTML, you could use it as the hook for a JQuery script. I couldn’t find a ready-made solution,, but I can outline what you’d need to do.

    1. Create a .js file to store the JQuery you’d need. A code sample (replace someclass with the actual class of the link):

    $(document).ready(function(){
    $(‘a.someclass’).click(function(){
    window.open(this.href);
    return false;
    });
    });

    2. Create a PHP file with a function to enqueue the .js file; for details, see https://codex.wordpress.org/Plugin_API/Action_Reference/admin_enqueue_scripts.

    3. Upload the files (I’d put them in the mu-plugins directory), then test and debug your work. The two tricky parts are making sure the path to the .js file is correct when you enqueue it and then being certain that the JQuery selector is good.

    All that said, this is not necessarily something you should do, and I think this feature has been suggested and rejected as an addition to WP. If you have a small number of users and you provide training and/or documentation, you can include instructions to right-click on a link and choose Open in New Window. Then they have the power to choose how they want to view the page.

Viewing 1 replies (of 1 total)
  • The topic ‘Is there a function for admin "View Page" open in new window?’ is closed to new replies.