Skip to content

Instantly share code, notes, and snippets.

@n7studios
Created October 28, 2014 14:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save n7studios/b6c7fe185340eb66b881 to your computer and use it in GitHub Desktop.
Save n7studios/b6c7fe185340eb66b881 to your computer and use it in GitHub Desktop.
Envira Gallery: Open links in a new browser tab
<?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"';
}
?>
@modelliva
Copy link

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment