LFell
|
June 23, 2016 at 4:59 am
I have the following get_posts function:
$relatedevents = get_posts(array(
'post_type' => 'espresso_events',
'suppress_filters' => false,
'posts_per_page' => '3',
'meta_query' => array(
array(
'key' => 'related_sidbear_page_link', // name of custom field
'value' => get_the_ID(),
'compare' => 'LIKE'
)
),
'tax_query' => array(
array(
'taxonomy' => 'espresso_event_categories',
'field' => 'term_id',
'terms' => 139
)
)
));
Which works well, however, when I’m looping the results I need to access the Event Start date, however the event start date is protected:
foreach( $relatedevents as $relatedevent ):
$event_obj = $relatedevent->EE_Event;
$datetimes = $event_obj->datetimes_ordered();
echo "<pre>";
var_dump($datetimes);
echo "</pre>";
endforeach;
Is anyone aware of a method which will allow me to access the start date?
|