How to Replace street address with custom text when set to not display the address

Lets say you want to show some custom text when the Street Address on a listing is set to not display.

Single Listing

Archive Listing

Not showing the listing when editing a listing

How to replace the street address with some custom text

Add the following to your custom settings plugin or theme functions file.

 // Replace street address with custom text when set to not display the address
function my_epl_display_text_address_callback() {
	global $property;

	if ( $property->get_property_meta('property_address_display') != 'yes' ) { ?>
		<span class="item-street">Contact for address details</span>
	<?php }
}
// Apply the custom function to the template hooks
add_action('epl_property_title','my_epl_display_text_address_callback' , 9 );
add_action('epl_property_tab_address','my_epl_display_text_address_callback' , 9 );
add_action('epl_property_address','my_epl_display_text_address_callback' , 9 );