Skip to content

Instantly share code, notes, and snippets.

@n7studios
Last active August 29, 2015 14:14
Show Gist options
  • Save n7studios/227957f0de441c6b781d to your computer and use it in GitHub Desktop.
Save n7studios/227957f0de441c6b781d to your computer and use it in GitHub Desktop.
Envira Gallery - Reload Enviratope on Click
<?php
/**
* Plugin Name: Envira Gallery - Reload Enviratope on Click
* Plugin URI: http://enviragallery.com
* Version: 1.0
* Author: Tim Carr
* Author URI: http://www.n7studios.co.uk
* Description: Register a click handler to reload Envira Gallery layouts. Useful when an Envira Gallery isn't visible on page load.
*/
/**
* Reload Enviratope on item click
*/
function envira_gallery_reload_enviratope( $data ) {
?>
$('.su-tabs-nav > span').on('click', function(e) {
setTimeout(function(){ envira_container_<?php echo $data['id']; ?>.enviratope(); }, 100);
});
<?php
}
add_action( 'envira_gallery_api_end', 'envira_gallery_reload_enviratope' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment