Created
October 28, 2014 14:08
-
-
Save n7studios/b6c7fe185340eb66b881 to your computer and use it in GitHub Desktop.
Envira Gallery: Open links in a new browser tab
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: Envira Hooks | |
* Plugin URI: http://enviragallery.com | |
* Description: Testing ground for hooks and filters | |
* Author: Tim Carr | |
* Author URI: http://thomasgriffinmedia.com | |
* Version: 1.0.0 | |
* Text Domain: envira-hooks | |
* Domain Path: languages | |
*/ | |
add_action( 'envira_gallery_output_link_attr', 'envira_link_newtab' ); | |
function envira_link_newtab () { | |
return 'target="_blank"'; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello and thank you for posting this code! I seem to be technically challenged. Where do I upload the envira-hooks.php file? I looked in the Envira plugin files / folders and pasted the php file shown here. My gallery images with external links still aren't opening in new pages. Do you by change know what I goofed up or know if this code will only work on envira pro accounts? Thanks again!