Skip to main content
added 13 characters in body
Source Link
Robert hue
  • 8.5k
  • 2
  • 34
  • 50

You can do that with jQuery. We can open this link in new tab/window by adding target="_blank" attribute dynamically on link which has URL https://www.example.com. Here is the example function for that.

function wpse_my_custom_script() {
    ?>
    <script type="text/javascript">
        jQuery(document).ready( function($) {
            $( "a[href$='https"ul#adminmenu a[href$='https://www.example.com']" ).attr( 'target', '_blank' );
        });
    </script>
    <?php
}
add_action( 'admin_head', 'wpse_my_custom_script' );

Don't forget to change URL in above code or this will not work.

Tested & working!

You can do that with jQuery. We can open this link in new tab/window by adding target="_blank" attribute dynamically on link which has URL https://www.example.com. Here is the example function for that.

function wpse_my_custom_script() {
    ?>
    <script type="text/javascript">
        jQuery(document).ready( function($) {
            $( "a[href$='https://www.example.com']" ).attr( 'target', '_blank' );
        });
    </script>
    <?php
}
add_action( 'admin_head', 'wpse_my_custom_script' );

Don't forget to change URL in above code or this will not work.

Tested & working!

You can do that with jQuery. We can open this link in new tab/window by adding target="_blank" attribute dynamically on link which has URL https://www.example.com. Here is the example function for that.

function wpse_my_custom_script() {
    ?>
    <script type="text/javascript">
        jQuery(document).ready( function($) {
            $( "ul#adminmenu a[href$='https://www.example.com']" ).attr( 'target', '_blank' );
        });
    </script>
    <?php
}
add_action( 'admin_head', 'wpse_my_custom_script' );

Don't forget to change URL in above code or this will not work.

Tested & working!

Source Link
Robert hue
  • 8.5k
  • 2
  • 34
  • 50

You can do that with jQuery. We can open this link in new tab/window by adding target="_blank" attribute dynamically on link which has URL https://www.example.com. Here is the example function for that.

function wpse_my_custom_script() {
    ?>
    <script type="text/javascript">
        jQuery(document).ready( function($) {
            $( "a[href$='https://www.example.com']" ).attr( 'target', '_blank' );
        });
    </script>
    <?php
}
add_action( 'admin_head', 'wpse_my_custom_script' );

Don't forget to change URL in above code or this will not work.

Tested & working!