Album is opening galleries in new tab
-
I have created a custom gallery page for each gallery on the website. In the album I have each gallery set to open a custom URL and have it set to the custom gallery page. I left the custom target as default.
This morning the galleries started opening in a new tab whereas previously they would open in the same tab. I want them to open in the same tab. I don’t know what happened or changed. There are about 20 galleries so going through and changing the target for each gallery is going to be laborious.
Looking at the code target=”default” is added to the link.
I tried the code below and it isn’t working. The code still shows target=”default”. Is there a reason why this may have suddenly changed?
EDIT: Using devtools I removed the target attribute from the link and it opens in the same tab.
add_filter('foogallery_attachment_html_link_attributes', 'foogallery_override_target', 10, 3); function foogallery_override_target( $attr, $args, $foogallery_attachment ) { $attr['target'] = '_self'; return $attr; }
- The topic ‘Album is opening galleries in new tab’ is closed to new replies.