Last active
February 13, 2016 16:28
-
-
Save ericakfranz/6dcf938b20546cbc2dfc to your computer and use it in GitHub Desktop.
This file contains hidden or 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 Gallery - Image Captions below Thumbnails | |
* Plugin URI: http://enviragallery.com | |
* Version: 1.0 | |
* Author: Tim Carr | |
* Author URI: http://www.n7studios.co.uk | |
* Description: Display captions below images | |
*/ | |
/** | |
* Display image captions below thumbnails | |
* | |
* @param string $output Output HTML | |
* @param int $id Image Attachment ID | |
* @param array $item Image Data | |
* @param array $data Gallery Data | |
* @param int $i Image Count | |
* @return string Output HTML | |
*/ | |
function envira_gallery_image_captions( $output, $id, $item, $data, $i ) { | |
if ( isset( $item['caption'] )) { | |
$output .= '<div class="caption">' . $item['caption'] . '</div>'; | |
} | |
return $output; | |
} | |
add_action( 'envira_gallery_output_after_link', 'envira_gallery_image_captions', 10, 5 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment