invp_get_the_location( int $post_ID = null )

invp_get_the_location


Description Description

Template tag. Returns the address where this vehicle is located. Address may contain line break characters.

The location taxonomy terms contain full street addresses in the term description.


Top ↑

Parameters Parameters

$post_ID

(int) (Optional)

Default value: null


Top ↑

Return Return

(string)


Top ↑

Source Source

File: includes/template-tags.php

function invp_get_the_location( $post_ID = null )
{
	if( empty( $post_ID ) )
	{
		$post_ID = get_the_ID();
	}

	/**
	 * We want the term description from the location taxonomy term
	 * because the meta key/term name only contains street address line one.
	 */
	$location_terms = wp_get_post_terms( $post_ID, 'location' );
	return implode( ', ', array_column( $location_terms, 'description' ) );
}