2
votes

I'm working on wordpress media library tab. Inside this iframe, I provide a link with target="_blank". I expect this link leads to a new browser tab or window, but it opens the link inside the iframe tab. This is the link:

$view = '<a href='.get_permalink($attach->ID).' target="_blank">'.$attach->post_title.'</a>';

How can I make it go to a new browser window?

2

2 Answers

1
votes

By default it should open in new tab/window.

try to change to

$view = '<a href="'.get_permalink($attach->ID).'" target="_blank">'.$attach->post_title.'</a>';

add quotes in url

2
votes

_top will work.That will redirect topmost parent to the new url.