MEC_HELPERS::get_event_location()

Returns the location of the event.

Contents


Return Return

(mixed) Returns null when location term does not exists. Otherwise, returns the location in string.


Source Source

File: src/integrations/modern-events-calendar/helpers/mec-helpers.php

	public function get_event_location() {

		$location      = '';
		$location_id   = end( $this->event_meta['mec_location_id'] );
		$location_term = get_term( $location_id, self::TAXONOMY_LOCATION );

		if ( is_wp_error( $location_term ) ) {
			return null;
		}

		$location = $location_term->name;

		return $location;

	}