Support » Plugin: Custom Dashboard Widgets » Open Link in New Tab

  • Hi,
    First, I am really happy with this plugin. It’s awesome. I would like to make one single modification: when the user clicks on a dashboard icon, to open the page in a new tab by default, like target=”_blank”.
    Could you indicate to me which line of code shall I change to achieve this result?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter luisrotelli

    (@luisrotelli)

    I have found in the function custom_dashboard_widget() the line:

    echo '<div class="'.$widget_button_class.'">
    	<a href="'.$link.'">
    	'.$icon.'
    	<h3>'.__($item['title']).'</h3>

    Changed to:

    echo '<div class="'.$widget_button_class.'">
    	<a href="'.$link.'" target="_blank">
    	'.$icon.'
    	<h3>'.__($item['title']).'</h3>

    It worked.
    Seems that this could be an useful option to set up. I suggest to add a check box to the admin configure if he wants the links to open in the same window or in a new tab.
    Thanks again for this amazing plugin.

    • This reply was modified 6 years, 5 months ago by luisrotelli.
    • This reply was modified 6 years, 5 months ago by luisrotelli.
    • This reply was modified 6 years, 5 months ago by luisrotelli.

    Second vote for this, it would be awesome to have a check box next to the rows to allow you to open certain items in a new window.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Open Link in New Tab’ is closed to new replies.