MEC_HELPERS::get_event_organizer()

Returns the Event Organizer.

Contents


Return Return

(mixed) Returns null when org term is empty. Otherwise, returns the organizer in string format.


Source Source

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

	public function get_event_organizer() {

		$organizer      = '';
		$organizer_id   = end( $this->event_meta['mec_organizer_id'] );
		$organizer_term = get_term( $organizer_id, self::TAXONOMY_ORGANIZER );

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

		$organizer = $organizer_term->name;

		return $organizer;

	}