Thank you angelo. I’ve created this code and placed it in child theme functions.php file:
<?php
/**
* add some conditional output conditions for Events Manager
* @param string $replacement
* @param string $condition
* @param string $match
* @param object $EM_Event
* @return string
*/
function filterEventOutputCondition($replacement, $condition, $match, $EM_Event){
if (is_object($EM_Event)) {
switch ($condition) {
// replace LF with HTML line breaks
case 'nl2br':
// remove conditional
$replacement = preg_replace('/\{\/?nl2br\}/', '', $match);
// process any placeholders and replace LF
$replacement = nl2br($EM_Event->output($replacement));
break;
// #_ATT{NON_LOCATION}
case 'is_skype':
if (is_array($EM_Event->event_attributes) && !empty($EM_Event->event_attributes['Skype']))
$replacement = preg_replace('/\{\/?is_skype\}/', '', $match);
else
$replacement = '';
break;
case 'is_tba':
if (is_array($EM_Event->event_attributes) && !empty($EM_Event->event_attributes['TBA']))
$replacement = preg_replace('/\{\/?is_tba\}/', '', $match);
else
$replacement = '';
break;
case 'is_tele_class':
if (is_array($EM_Event->event_attributes) && !empty($EM_Event->event_attributes['Tele-class']))
$replacement = preg_replace('/\{\/?is_tele_class\}/', '', $match);
else
$replacement = '';
break;
case 'is_google_hangout':
if (is_array($EM_Event->event_attributes) && !empty($EM_Event->event_attributes['Google Hangout']))
$replacement = preg_replace('/\{\/?is_google_hangout\}/', '', $match);
else
$replacement = '';
break;
}
}
return $replacement;
}
add_filter('em_event_output_condition', 'filterEventOutputCondition', 10, 4);
and have the following event attribute of #_ATT{NON_LOCATION} where I’m entering “Skype”.
On the Single Event Page format, I have:
{no_location}{is_skype}<img src="path to Skype icon" alt="" />{/is_skype}{/no_location}
I have tried both with and without the {no_location} conditional placeholder to no avail.
What am I missing?
Regards,
Andrew