lundi 5 octobre 2015

Making menu link open in new tab?

I'm trying to add a top level menu to the left sidebar of the WordPress admin panel.

Here's the code I currently have:

add_action( 'admin_menu', 'linked_url' );
function linked_url() {
add_menu_page( 'linked_url', 'Menu Title', 'read', 'my_slug', '', 'dashicons-text', 1 );
}

add_action( 'admin_menu' , 'linkedurl_function' );
function linkedurl_function() {
global $menu;
$menu[1][2] = "https://www.example.com";
}

This code DOES work and links the menu to an external page (https://www.example.com).

I learned how to do this from here: http://ift.tt/1OUiBbT

However, I can't figure out how to make the external link open in a new tab. I'd prefer than a new tab/window is opened so people don't lose what they already have open in their admin area.

Is there something I need to change or add? Or is it just not possible?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire