Display Envira Gallery publish date in Album view if image count is also displayed.
<?php
/**
* Plugin Name: Envira Gallery - Display Gallery Publish Date in Album View
* Plugin URI: http://enviragallery.com
* Version: 1.0
* Author: Mo Noman
* Author URI:
* Description: Display the gallery publish date before the image count in Album display.
*/
/**
* Display Gallery Publish Date in Album View
*
* @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_album_gallery_publish_date( $output, $id, $item, $data, $i ) {
if ( isset( $item['publish_date'] )) {
$output .= '<div class="envira-gallery-publish-date">' . $item['publish_date'] . '</div>';
}
return $output;
}
add_action( 'envira_albums_output_before_image_count', 'envira_album_gallery_publish_date', 10, 5 );