While digging through it’s documentation, I found references to these placeholders used for the contact person in the various templates. Looking at the source code, those placeholders are associated with the event_owner
which is also the same as the post author for the event, so technically speaking, the code snippet from earlier should also work when the CF7 form is used on the event pages, especially if the event owner is a registered user in your WordPress website.
Sources:
However, because there can be anonymous users, it’s probably best to use their get_contact()
function instead of assuming the event author is the same as the event contact, so that custom shortcode would look like this:
function msteidl_event_contact() {
// Bail if the function doesn't exist, this is to prevent fatal errors for deactivating events manager plugin
if(!function_exists('em_get_event')) return '';
// Get the current event
$event = em_get_event(); // Returns object of class EM_Event
// Get the contact
$contact = $event->get_contact(); // Returns object of class EM_Person
// Return their name
return esc_attr(trim(sanitize_text_field($contact->get_name())));
}
add_shortcode('msteidl_event_contact', 'msteidl_event_contact');
Definitions:
Links to the code and such is mostly for others that come across this thread or for when I want to reference it in the future, so if you’re not tech savvy, that’s okay ??
Hope this sorts out your needs!