I have some custom code that I wrote from various resources you have online and part of it populates a site search with various filters. It was all working ok up until our update today.
It is basically failing to create an instanceof EE_Event. I just wondered whether this was an issue that someone has seen before. The query returns the course information within the post details but fails to load the EE_Event object.
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;
}
Thanks so much for providing the extra details. It looks like the custom code is using a deprecated classname. You can change this:
$wp_query = new EE_Event_List_Query( $atts );
to this:
$wp_query = new EventEspresso\core\domain\services\wp_queries\EventListQuery( $atts );
and that should get things working the way they were before.
Viewing 2 reply threads
The support post ‘Can't create instance of EE_Event since update`’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.
Support forum for Event Espresso 3 and Event Espresso 4.