Hey, I see you posted this a month ago. Not sure if you found a solution or not, but for anyone who is looking for a solution to get the error from being displayed, I have an answer. It’s a simple fix really.
Here is the original line of code in the “simple-events-calendar.php” file:
$the_events[] =
'<ul style="list-style:none; padding:0 0 0 15px; margin:10px 0;" class="vevent"><li style="list-style:none;"><h3 class="summary" style="margin:0;">'.
stripslashes($event['event_title']).
'</h3></li><li class="description" style="list-style:none;">'.
stripslashes($event['event_desc']).
'</li><li style="list-style:none;"><span style="font-weight:bold;">'.__('When:',SE_TEXTDOMAIN).' </span><abbr class="dtstart" title="'.
date('Y-m-d',$event['event_start']).'T'.date('H:i',$event['event_start']).
'">'.
$eventtime.
'</abbr> - <abbr class="dtend" title="'.
date('Y-m-d',$event['event_end']).'T'.date('H:i',$event['event_end']).
'">'.
strftime( __('%H:%M',SE_TEXTDOMAIN),$event['event_end']).
'</abbr>'.
'</li>'.
$evt_loc.
$evt_url.
'</ul>';
} // end foreach ($allevents as $event)
$items = implode($the_events);
return($items);
You need to change it to an ‘if’ statement to find out whether we have a title(which is a required field) of an event, and if so, carry out the original code. Then you just add an ‘else’ statement that basically tells it to do nothing.
Final code:
if ($event['event_title']) {
$the_events[] =
'<ul style="list-style:none; padding:0 0 0 15px; margin:10px 0;" class="vevent"><li style="list-style:none;"><h3 class="summary" style="margin:0;">'.
stripslashes($event['event_title']).
'</h3></li><li class="description" style="list-style:none;">'.
stripslashes($event['event_desc']).
'</li><li style="list-style:none;"><span style="font-weight:bold;">'.__('When:',SE_TEXTDOMAIN).' </span><abbr class="dtstart" title="'.
date('Y-m-d',$event['event_start']).'T'.date('H:i',$event['event_start']).
'">'.
$eventtime.
'</abbr> - <abbr class="dtend" title="'.
date('Y-m-d',$event['event_end']).'T'.date('H:i',$event['event_end']).
'">'.
strftime( __('%H:%M',SE_TEXTDOMAIN),$event['event_end']).
'</abbr>'.
'</li>'.
$evt_loc.
$evt_url.
'</ul>';
$items = implode($the_events);
}
else {
$items = "";
}
} // end foreach ($allevents as $event)
return($items);
It should work. Let me know if it is doing otherwise. Cheers!