/** * Return the event type label for given event ID. * * @since 1.3 * @param int $event_id ID of the current event. If not set, check for global $post and $post_id. * @param bool $raw True to return the raw slug of the event type, false for the label * @return str Label for current event type. */ function mdjm_get_event_type($event_id = '', $raw = false) { global $post, $post_id; if (!empty($event_id)) { $id = $event_id; } elseif (!empty($post_id)) { $id = $post_id; } elseif (!empty($post)) { $id = $post->ID; } else { $id = ''; } if ($raw) { return mdjm_get_event_type_raw($id); } $event = new MDJM_Event($id); // Return the label for the status return $event->get_type(); }