<?php
/**
 * Template part for displaying entry tags.
 *
 * @package     Business Interface
 * @author      WPInterface Team
 * @since       1.0.0
 */

$business_interface_entry_elements    = business_interface_option( 'single_post_elements' );
$business_interface_entry_footer_tags = isset( $business_interface_entry_elements['tags'] ) && $business_interface_entry_elements['tags'] && has_tag();
$business_interface_entry_footer_date = isset( $business_interface_entry_elements['last-updated'] ) && $business_interface_entry_elements['last-updated'] && get_the_time( 'U' ) !== get_the_modified_time( 'U' );

$business_interface_entry_footer_tags = apply_filters( 'business_interface_display_entry_footer_tags', $business_interface_entry_footer_tags );
$business_interface_entry_footer_date = apply_filters( 'business_interface_display_entry_footer_date', $business_interface_entry_footer_date );

// Nothing is enabled, don't display the div.
if ( ! $business_interface_entry_footer_tags && ! $business_interface_entry_footer_date ) {
	return;
}
?>

<?php do_action( 'business_interface_before_entry_footer' ); ?>

<div class="entry-footer">

	<?php
	// Post Tags.
	if ( $business_interface_entry_footer_tags ) {
		business_interface_entry_meta_tag(
			'<div class="post-tags"><span class="cat-links">',
			'',
			'</span></div>',
			0,
			false
		);
	}

	// Last Updated Date.
	if ( $business_interface_entry_footer_date ) {

		$business_interface_before = '<span class="last-updated si-iflex-center">';

		if ( true === business_interface_option( 'single_entry_meta_icons' ) ) {
			$business_interface_before .= business_interface()->icons->get_svg( 'edit-3' );
		}

		business_interface_entry_meta_date(
			array(
				'show_published' => false,
				'show_modified'  => true,
				'before'         => $business_interface_before,
				'after'          => '</span>',
			)
		);
	}
	?>

</div>

<?php do_action( 'business_interface_after_entry_footer' ); ?>
