victorypoint
Forum Replies Created
-
Solved. I needed to declare the $event variable before calling EM_Event. I don’t remember having to to do this before. I guess my host must be using newer PHP.
$event = null;
$event = new EM_Event($postID, ‘post_id’);-Al
Hi. Yes, I use $postID instead of $post. It’s value is passed to my function as follows. My code is in separate php files for a plugin I’m developing.
public static function getEventPostData($postID){
$postType = get_post_type($postID); //returns event
if($postType != EM_POST_TYPE_EVENT)
return(array());
//$event = new EM_Event($postID, ‘post_id’); //old code is crashing here
$event = em_get_event($postID->ID, ‘post_id’); //new code is crashing here
$location = $event->get_location();
$arrEvent = $event->to_array();
$arrLocation = $location->to_array();-Al
Thanks Angelo for responding. I tried your suggestion as follows but still get the same result.
$postType = get_post_type($postID); //returns event
if($postType != EM_POST_TYPE_EVENT)
return(array());
//$event = new EM_Event($postID, ‘post_id’); //old code is crashing here
$event = em_get_event($postID->ID, ‘post_id’); //new code is crashing here
$location = $event->get_location();
$arrEvent = $event->to_array();
$arrLocation = $location->to_array();-Al
Update: After more testing, I narrowed down the incompatibility between Events Manager and Revolution Slider plugins. I can create a post-based slider using events post-type and set the slide background source to Image BG and the slider works fine. If I add a text/html layer and add any caption or meta tag (it doesn’t matter which), this breaks the revolution slider plugin. Deleting all layers unbreaks the slider plugin.
Has anyone else experienced this issue or can reproduce it? I’m really hoping someone has a solution or workaround.
-Al