Support

Home Forums Event Espresso Premium Can't create instance of EE_Event since update` Reply To: Can't create instance of EE_Event since update`

Reply To: Can't create instance of EE_Event since update`

Author Replies
Damian Way # Posted on May 10, 2018 at 8:21 am

I am guessing that this may be connected to the method I used for retrieving the events list. I am not converting this from using a deprecated method to using the EEM_Event::instance()->get_all() method but my understanding is a little limited. Are there any examples of how to retrieve all events by category slug?

My previous method for retrieving the events was:
function sts_get_courses_detail($category_slug = Null, $venue_slug = Null){
$atts = array(
'title' => NULL,
'limit' => 100,
'css_class' => NULL,
'show_expired' => FALSE,
'month' => NULL,
'category_slug' => $category_slug,
'order_by' => 'start_date',
'sort' => 'DESC'
);
// run the query
global $wp_query;
$wp_query = new EE_Event_List_Query( $atts );
return $wp_query;
}

Do NOT follow this link or you will be banned from the site!