<?php
/**
 * Title Price Hover Overlay
 *
 * @package Total WordPress Theme
 * @subpackage Partials
 * @version 4.0
 */

// Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

// Only used for inside position
if ( 'inside_link' != $position ) {
	return;
}

// Get post data
$title = isset( $args['post_title'] ) ? $args['post_title'] : get_the_title();
$date  = isset( $args['post_date'] ) ? $args['post_date'] : get_the_date();

// Output overlay
$output = '<div class="overlay-title-price-hover overlay-hide theme-overlay textcenter">';
	$output .= '<div class="overlay-table clr">';
		$output .= '<div class="overlay-table-cell clr">';
			$output .= '<div class="overlay-title">'. esc_html( $title ) .'</div>';
			// Function check needed since it's added as a helper only if Woo is enabled
			if ( function_exists( 'wpex_get_woo_product_price' ) && $price = wpex_get_woo_product_price() ) {
				$output .= '<div class="overlay-price">'. $price .'</div>';
			}
		$output .= '</div>';
	$output .= '</div>';
$output .= '</div>';

echo $output;