[Plugin: All-in-One Event Calendar] Get filtered upcoming events through PHP
I would like to display the next event out of two categories. I browsed several forums and had a look into the helper functions, but somehow not everything seems to work.
Here is my approach.
global $ai1ec_calendar_helper, $ai1ec_events_helper; // gets localized time $bits = $ai1ec_events_helper->gmgetdate( $ai1ec_events_helper->gmt_to_local( time() ) ); //sets start time to today $start = gmmktime(0,0,0,$bits['mon'],$bits['mday'],$bits['year']); // here: filtering of categorie / categories; seems not to work $filter["cat_ids"] = "4"; // Get the next (here two) posts out of the DB $get_events = $ai1ec_calendar_helper->get_events_relative_to($start, 1, 0, $filter); var_dump($get_events);
This is my approach so far; the events are getting outputted but not filtered; all events are outputted. Regardless what I try to filter, it doesn’t work. Can somebody help me with this? Thanks a lot.
- The topic ‘[Plugin: All-in-One Event Calendar] Get filtered upcoming events through PHP’ is closed to new replies.