<?php

namespace Saswp;

function property_pid_shortcode()
{
	$settings = new \Saswp\Settings();
	$property = new \Saswp\Repository\PropertyRepository();
	$propertyDTO = $property->get($settings->get('sas_one_property_page_id'))->getProperty();
	if ($propertyDTO->gov_registration_ref) {
		return '<h5 class="property-pid">' . esc_html($propertyDTO->gov_registration_ref) . '</h5>';
	} else {
		return '<div class="property-pid" data-shortcode="property_pid"></div>';
	}
}

?>
