'',
), $atts );
if ( get_post_type( get_the_ID() ) != 'property' )
{
return '';
}
fusion_element_rendering_elements( true );
global $property;
if ( empty($property) )
{
$property = new PH_Property(get_the_ID());
}
ob_start();
if ( get_option('propertyhive_epcs_stored_as', '') == 'urls' )
{
$epc_urls = $property->_epc_urls;
if ( is_array($epc_urls) && !empty( $epc_urls ) )
{
echo '
';
if ( $atts['show_title'] == 'yes' ) { echo '
' . esc_html(__( 'EPCs', 'propertyhive' )) . '
'; }
foreach ($epc_urls as $epc)
{
echo '
 . ')
';
}
echo '
';
}
}
else
{
$epc_attachment_ids = $property->get_epc_attachment_ids();
if ( !empty($epc_attachment_ids) )
{
echo '';
if ( $atts['show_title'] == 'yes' ) { echo '
' . esc_html(__( 'EPCs', 'propertyhive' )) . '
'; }
foreach ( $epc_attachment_ids as $attachment_id )
{
if ( wp_attachment_is_image($attachment_id) )
{
echo '
) . ')
';
}
else
{
echo '
' . esc_html(__( 'View EPC', 'propertyhive' )) . '';
}
}
echo '
';
}
}
$html = ob_get_clean();
fusion_element_rendering_elements( false );
return $html;
});